Birds have evolved unique adaptations that allow them to sleep safely on tree branches. Special tendon and leg structures automatically secure their feet when their legs bend, which maintains balance even in slightly moving branches. Some birds also utilize their foot shape and balance for perching, while others may choose to rest on one leg to conserve heat during colder weather.