They twist around in the air so they land the right way up. The key to doing this is that the cat doesn’t panic. Luckily they do so instinctively and it is called the righting reflex and the average cat needs a bit less than a metre to do so.
There is something called high-rise syndrome which is when cats fall out of the windows of high-rise buildings. The overall survival rate is 90% which is pretty good and the study that found this looked at 2-32 storeys.
There was another study that looked at survival rates from different heights. Cats that fall from less than 6 storeys and survive tend to have worse injuries that cats that fall from over 6 storeys. It is thought that when they fall from a greater height, they eventually relax and so land properly helping to prevent injury.