In this picture, you can see the Delta IV heavy rocket.
Pay attention to the propellant gas coming out of the booster; It is clear that as soon as it leaves the nozzle, the path of the gas becomes thinner!
After this contraction and thinning of the gas volume, it expanded again and contracted again and expanded again and...; This special shape can be seen in the exhaust gas of all three engines, which is tens of meters long.
The reason is that the atmospheric pressure is higher during gas release!
But it should be noted that even though this rocket is in the atmosphere, it has a low efficiency, but when it gets higher and the atmosphere becomes thinner, the pressure of the gas exiting the nozzle is almost equal to the pressure of the air outside the nozzle, so the efficiency increases!