Jake Blocker's excellent answer explains what a dogleg maneuver is, what it's for, what it looks like, and even what a real dog's leg looks like for comparison!
A dogleg maneuver is done to change the inclination of a certain payload, and the reason it limits the payload capacity is most likely due to the cosine losses.
In this answer I mention an incident which might be the reason that dogleging to orbit was invented, but I don't know.
Question: Which launch was the first to dogleg?