1 It's an innate reflex
According to Wikipedia cats have an innate reflex, called cat righting reflex, which allows the cat to always land on its feet. The reflex is developed around 3-4 weeks of age and is perfected at 6-7 weeks. See why do cats bite humans.
2 Cats have an unusually flexible backbone
Cats have an unusually flexible backbone. This allows them to absorb strong shocks as they land on their feet thus giving them the ability to survive falls from big heights.
3 Cats have no functional clavicle
Cats have no functional clavicle (collarbone). This gives the cat's body more flexibility and allows it to absorb shocks easily. See why do cats stare into space.
4 Their body can rotate around different axis
The flexibility of a cats body gives it the ability to rotate around different axis. The front of the body can rotate around a certain while the back of the body can rotate around a different one. This allows the feet of the cat to face the floor easily.
5 They fall with lower terminal velocity
Cats fall with a lower terminal velocity than humans. This is due to their light body, thick fur and small size. This allows the cat to adjust its position in the air so that it falls on its legs.
6 It uses the inner ear system
Cat's have an inner ear system that allows them to know their position relative to the ground. This allows cats to adjust their position as they fall so that they land on their feet.
7 It depends on the height
According to Wikipedia a cat needs at least 30 centimeters to be able to adjust its body and land properly on its feet. Some suggest that the bigger the distance gets the easier it is for the cat to adjust its body.
8 The head twists first
Based on the information coming from the inner ear the cat twists its head to face the ground. Next the cat starts adjusting its body to fall properly.