How does it do that?

I was processing photos from a recent trip to Lotherton Hall Bird Garden today.  One of images was of this famingo.  It suddenly struck me that I don’t think I have ever seen any animal bend it’s neck into a “figure of eight” shape before.