system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do we bob our heads/tap feet to music?
gpt
Music is kind of a weird phenomenon. It likely wasn't an intended thing for humans to have (as much as evolution can have an intention), but is just a side effect of the brain developing to do other things. Music stimulates huge swathes of the brain across many different areas. One area is the part of the brain that also processes movement. The brain is a set of connected cells sending signals between each other, so when a signal is sent to do one thing, if it's sent along a pathway that's also involved in another thing, the other thing is likely to occur simultaneously. For example, when we recall a memory, we often also experience a milder version of the same emotion we felt when the memory was being encoded. 

When the area of the brain that controls movement responds to music, it unintentionally also creates signals that compel our body to move, and these signals are triggered to some kind of pattern in the music, whichever pattern that part of the brain has decided to pay attention to. That's usually the beat, but it can be the melody or even a countermelody, whichever pattern is most predictable and prominent to the brain (the more you know the music the more likely your brain is to latch onto something other than the beat). Now, you can do something with those signals. You can consciously send a signal that suppresses the movement signals, but that can be quite uncomfortable and it's hard to do. Dancing was invented as a result of people leaning into the signals for movement and harnessing them for entertainment purposes, instead of suppressing them.