The praying mantis mimics plants in order to hide from predators and prey. ... Swaying repetitively from side to side is a common camouflage behavior of the praying mantis. It might be used to mimic the swaying movement of vegetation in the wind.
Why does the praying mantis dance?
The dance of death: Male praying mantises dance seductively to attract a mate... who will later bite their heads off | Daily Mail Online.
Why do praying mantis move their abdomen?
When the insect breathes, the flexible sections enable the abdomen to expand. Female praying mantids have a very dextrous abdomen and are capable of highly controlled movements, especially during egg-laying.