By quoting a paper published in 1991, the author wrote that the avian talon works through a pulley system which can lock into place.
This explains why birds can stay on the branch even while sleeping. It is an automated mechanism, and it also explains how raptors catch their prey in midair.
Raptors swoop down on prey with talons/legs outstretched. The impact with the prey folds the raptor’s legs against its body, causing the talons to clench automatically,tearing into the prey. The automatic grip is strong enough to kill, and is what allows many hawk species to catch and kill other birds in midair.
However, I would like to remind you that not all birds have this pulley system in their legs.
A 2010 paper found that such a mechanism did not exist in the European starling. Well, actually there are several other birds that do not possess such awesome pulley system. Just ask Google.
The first species of bird that came to my mind was the Red-capped Manakin, otherwise also known as the Michael Jackson of the forest. In order to pull off a Michael-Jackson on the branch, the bird must be able to relax its talon sufficiently in order to break the control of the pulley system.
|A Red-capped Manakin with its legs straightened, and its talons gripping the branch. Image: http://weepingwillowmoon.blogspot.com|
Secondly, a bald eagle can still stretch its talons even when it bends its legs.
|A bald eagle stretches its talons with its legs bent. Image: http://wildinidaho.blogspot.com|
An African fish eagle can also exert a tight grip on slippery fish with both its legs straightened.
It shows that not all raptors utilize this mechanism, and certain not all birds have it.