What is the purpose for a rabbits tail?

Bunnies tails are used in the wild to tell other bunnies if there is danger. They will flick up their tails to show the white undercoat to warn the others