Tendon locking
The leg arrangement of passerine birds has a special adaption for perching: a tendon-locking mechanism. A tendon in the rear of the leg is automatically pulled and tightened when the leg bends. This makes the foot curl stiffly round when the bird lands on a branch. The tendon is locked in place by another tendon. So passerines sleep while perching without falling off.