If you watch the dazzling display of a male bird-of-paradise as he woos a potential mate, it is hard to call it anything but a dance. To make his moves even more visually appealing, the male sometimes moves debris out of the way, so that any curious female can see his display in all its resplendent beauty.

Other animals also seem to dance. Take a look at Snowball, the famous dancing cockatoo, or at this sea lion moving in time to Michael Jackson's "Thriller". Sure, they may not be doing the pirouettes and assemblés seen in classical ballet. But like us, these animals can take years to learn some extremely sophisticated dance moves.

Despite the skills these animals show, there has been a running debate about whether the ability to dance is unique to humans, or whether it is rooted in our shared evolutionary history with the animal kingdom. There are now two leading theories about the origin of dance – but it is not yet clear whether either of them holds the whole truth.

There is no one way to define dance. This makes it difficult to compare our tangos or ballets to the movements we see in animals. But when you split dancing into its component parts, it becomes easier to see similarities.

There are some clear fundamental skills involved. One is moving in time to a rhythm, which humans usually do to some sort of music or beat. Another is synchronising your movements with another individual. Imitation of others is also crucial, as it enables keen dancers to learn more complex moves.

I don't know there is a set of necessary criteria that would isolate dance and include no other behaviours

But even these isolated behaviours depend on several things at once. For instance, sound is processed by the auditory part of the brain, while movement involves the motor cortex. "I don't know there is a set of necessary criteria that would isolate dance and include no other behaviours," says Peter Cook of the New College of Florida in Sarasota, US.

It is becoming easier to study many of these key components for dance in the animal kingdom. This has led several researchers to question how dance may have evolved.

This question has only been studied in earnest in the last decade.

When a clip of Snowball the dancing cockatoo first appeared online in 2007, researchers were baffled. Here was an animal seemingly dancing in synchrony to a beat, something that had previously only been attributed to humans.

Snowball, they concluded, was able to dance because he belongs to a vocal species. It is this skill that helps him to perceive a beat.

The strongest case of motor imitation in animals comes from humans

That is because a key component for both is imitation. In a paper published in 2016, which surveyed the last decade of studies in the field, researchers proposed that the ability to imitate must be a fundamental component of dance. "People solve these challenges by harnessing the same neural architecture as deployed in imitation," they wrote.

This led the researchers to ask why humans can so effortlessly dance to complex rhythms, while most animals like dogs, monkeys and cats cannot.

Take the famous painting The Dance Class 1873-76 by Edgar Degas below. It shows a group of girls watching others dance, perhaps intending to imitate the dancers on their next try. Degas's painting is a showcase of our exceptional imitation skills.

Nicky Clayton of the University of Cambridge, UK is one of the authors of the 2016 paper. She studies birds and is also a dancer.

Clayton argues that "the strongest case of motor imitation in animals comes from humans doing things like ballet and contemporary dance. You don't just have to copy the image, you have to translate it into your body. It's the precise movements that are key."

That is also why she and her co-authors argue that vocal learning, which requires the ability to learn songs or speech using imitation, is directly tied to our ability to dance. This is called the "vocal learning hypothesis" and it was first put forward in 2006. It proposes that only other animals with the capacity for vocal learning can "move in rhythmic synchrony to a musical beat".

Maybe we just get dance for free, we didn't necessarily evolve to be good dancers

A 2008 study of bird brains explains why this may have come about. The brain areas involved with movement and vocal learning are side-by-side, and the latter evolved as a "specialisation of a pre-existing pathway" for movement.

If the vocal learning hypothesis is correct, the ability to move to a rhythmic beat would be limited to the most vocal species. That means parrots and songbirds; cetaceans, which include whales, dolphins and porpoises; and pinnipeds such as sea lions and seals. Most of these animals are vocal learners.

In other words, Clayton and her colleagues conclude, dance is simply a by-product of imitation. "Maybe we just get dance for free, we didn't necessarily evolve to be good dancers," says Cook.

However, there are other ideas as to how dance evolved.

Cook and his colleague Andrea Ravignani do not agree that the vocal learning hypothesis tells the whole story. In a response paper published in October 2016, they say that, while imitation is certainly important, there is more to dance than imitation alone.

For starters, the ability to tap your foot to a rhythm does can be learnt without imitation. So can inventing a novel dance move from scratch, as improvisational dancers so often do.

The perception, if not the enjoyment, of musical cadences and of rhythm is probably common to all animals

Further, Cook says that the "changes in the brain that allowed humans to dance" must have come from a basic ability to "attend to rhythm in a social context". This ability – "not dance per se, but the ability to sense rhythm and use it socially" – is widely distributed in the animal kingdom.

The 19th-Century biologist Charles Darwin thought something similar. In his 1871 book The Descent of Man, he wrote that "the perception, if not the enjoyment, of musical cadences and of rhythm is probably common to all animals and no doubt depends on the common physiological nature of their nervous systems."

Evidence is now coming together to show that Darwin was onto something.

In a 2013 paper, Cook reported that a Californian sea lion showed rhythmic abilities despite being a non-vocal learner. The animal is also pretty good at dancing. The sea lion can bob its head at varying speed in response to a rhythmic pattern, rather than simply copying a trainer as other dancing pinnipeds are suspected to do.

Among our closest relatives, the primates, several species show clear rhythmic skills. Monkeys and apes are able to drum on logs, and they also often hoot together at the same time.

There is this very basic ability to be sensitive to rhythm in the environment and use it in social ways

Even more distantly-related animals show innate rhythmical abilities. They include ring-legged fiddler crabs, which wave their claws in dance-like group displays, and foot-flagging frogs, which gesture rhythmically with their feet.

Cook says these animals, and many others, use rhythm for all sorts of behaviours that bear little resemblance to dance. "It might be co-foraging behaviour, or it might be ritualised behaviour when trying to compete for mates," he says. "There is this very basic ability to be sensitive to rhythm in the environment and use it in social ways."

For Cook, rhythm is the basic skill needed for dance and it is found throughout the animal kingdom. It is just that different animals use it in different ways, depending on what is most important to them. "Our broad point is: if you want to think about fundamental things in the animal kingdom that might support dance, the basic capability is conserved, it is something that is built into animals all the way back."

In other words, while a small foot-flagging frog may not be able to dance along to Swan Lake, the ability to do so is, as Cook puts it, a "tweak of the same mechanism".

It is a compelling idea. But in recent years, evidence has mounted that neither hypothesis has all the answers.

In particular, it turns out that some animals that are good at vocal learning are surprisingly bad at rhythm. That is bad news for the vocal learning hypothesis, and it also seems to contradict Cook's idea that rhythm is universal.

For instance, a 2016 study discovered that zebra finches find it challenging to detect rhythmic patterns, and could not consistently discriminate between simple rhythms.

"Many animals can move in coordinated and rhythmic ways, but it doesn't mean they have a sensitivity to rhythms in general, or that they can synchronise a set of other behaviours with an external rhythm," says co-author Carel ten Cate of the University of Leiden in the Netherlands.

Being monkeys, rhesus macaques are much more similar to us than zebra finches. Yet surprisingly, these primates are not nearly as good as humans at perceiving a beat, according to a 2012 study of their brains.

How should we explain these failures of rhythm?

One possibility is that we have not devised the right tests to study the capabilities of these animals. Monkeys and apes clearly show some rhythmic skills, but perhaps they do not recognise rhythm in quite the same way we do.

Dance can evolve in different ways, presumably from a variety of starting points

Or there could be another factor in play. As Clayton and her team have pointed out, dancing requires highly-controlled body movements. To cope with this, humans have bigger brains than monkeys. It may be that the links between monkeys' motor and auditory systems are therefore weaker than ours, says Henkjan Honing of the University of Amsterdam in the Netherlands.

Chimpanzees, which are more closely related to us, may fare better. Research into their rhythmic capabilities is ongoing, with one 2015 study suggesting that they can follow the rhythm of a person tapping their finger.

There is one final possibility. Maybe human and animal dancing are not quite as similar as we first thought.

In humans, dance is thought to be closely intertwined with music. Some researchers have even suggested that one barely occurs without the other; you cannot listen to music without dancing, at least mentally. In line with this, some cultures only have one word that encompasses both concepts.

The same is not true of all dancing birds. Several species of bird-of-paradise perform their elaborate displays without singing, while others sing and dance together. Yet another species, the superb lyrebird, will dance without singing and sing without dancing, as revealed by a 2013 study.

There may not be a single catch-all explanation for animals dancing

This shows that song and dance are both voluntary, says co-author Anastasia Dalziell of Cornell University in Ithaca, New York. She had previously felt that it was impossible to study birdsong without also looking at dance, "as the two are so intertwined, they coordinate dance movements with song types." Yet her research has shown that there is a clear "disconnect between vocal and visual displays in birds".

For these birds, music and dance do not seem to be intertwined in the way they are for us. That suggests that the neural underpinnings of dance are different in birds and humans.

Considering the vast differences between humans and birds, this is not surprising. But it is a hint that dance can evolve in different ways, presumably from a variety of starting points. Maybe some species begin with rhythm and add other elements later, while other species begin with a knack for imitation and go from there.

In other words, there may not be a single catch-all explanation for animals dancing. Instead, the reasons why animals dance may be as diverse as the dances we humans have devised.

Melissa Hogenboom is BBC Earth's feature writer. She is @melissasuzanneh on Twitter.

Join over six million BBC Earth fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.