You can think about it (approximately) by dividing the rocket trajectory into "up" and "downrange" parts. The "downrange" part is the largest one: To get to orbit, the rocket has to generate a lot of speed in that direction.
The "up" part is quite different. To end up in a low, circular orbit, the rocket has to go "up" few hundred kilometers and stop.
If you just treat this a parabolic motion, "I'll build up some vertical speed and coast up until gravity stops me", that's fine for a high orbit: You blast out of the atmosphere and eventually stop at the right height. But it's not great if your orbit is a low one: To keep the vertical speed low enough (still fast, but comparatively slower than the first example), you spend a lot of time in the first part, still in the atmosphere. And that causes drag losses and heating you don't want.
So the first part of the flight builds up a lot of vertical speed to get you out fast. Now you're got too much vertical speed to end up in the right circular orbit, so later in flight you add a downwards component to the thrust so that you arrive at the right final altitude and stop.