Well i suppose the bottom side of their body is heavier due to the weight of the legs so there’s a natural turning effect that will bring the legs down. Slo-mo vidies of cats falling show they can also twist their bodies to get “legs down”. Due to evolution cats that aren’t good at falling get wiped out and only the goods ones get to pass their genes on!
The uniqueness of the cat’s skeleton is one of the reasons they can right themselves so quickly. Cats do not have a collarbone, and the bones in their backbone have more mobility than in many other animals. For these reasons cats have free movement of their front legs and they can also easily bend and rotate their bodies. This allows them to land feet first. Their feet and legs can cushion the impact.