Convergent evolution
Small animals which sleep in trees: Many hang on with their feet, in which case they usually have a tendon locking device which keeps them hanging on even during sleep. Once the tendons are locked, the muscles in their legs and feet can relax. Even dead bats stay hanging. These various examples have evolved independently of each other: this is known from the fine details of the mechanism. One plus of a locking mechanism is that it allows attachment to slender branches on which predators might be unable to walk.