In the wild chicken will fly onto elevated branches in trees for resting and sleeping to protect themselves from their natural enemies.
Read more here.