A booster flip is performed to re-orient it with the engine pointing towards Earth in order to ensure smooth and safe landing

It is important for a rocket booster to attain high forward speed to reach orbit. Once the booster’s work is done launching the first stage into orbit, it needs to return back to Earth for reuse. At such an altitude, inertia takes over and the booster needs to be fired retrograde to slow down its velocity. For that to happen, a boostback burn is performed to flip the rocket Another important reason a flip is performed is because at this point, the booster has reduced its total mass due to fuel usage, thus making it easier for the engine thrust to transfer momentum and slow the rocket down. The overall trajectory of the booster is greatly influenced by the Eccentricity of the orbit

Note

Retrograde: Opposite direction to that of motion Prograde: Same direction as that of motion

After the flip, a thrust fired in a direction other than retrograde or a lesser thrust results in a change in velocity, which is called the Delta-V

Why does the SpaceX Falcon 9 rocket do a 180 flip for reentry? - Space Exploration Stack Exchange