Have you ever wondered how fish swim in a shoal or how birds can fly co-ordinated or why herds run in the same directions. Animals are born with an inbuilt ability to mirror what is happening around them.
It's difficult to know where this all begins but think about it. Life is short. Any animal must learn to adapt to its environment. It will be born with a certain amount of genetic information to help. But the quickest, most efficient way of learning is to learn through others.
We are really just learning about all of this but so much of it makes sense. Your sensory and motor systems are not two distinct systems. They flow one into the other. When a monkey sees an action in another monkey exactly the same planning neurons become activated in it as in the other monkey. It imitates automatically what it sees in the other monkey. It recreates internally what it sees in the other monkey. It doesn't carry out the action (although it could) but it has an internal representation of that action.
It begs the question - how much of our learning is done by copying?
When we want to teach a child a new skill we don't move its muscles to achieve the skill - we show the child. We rely on the short cut of see, imitate and copy.
Similarly when we hear a sound we don't just passively hear it. If the sound is made by another human we mirror it too. We pre-plan it. We almost imitate it in our own minds. It's how we learn sounds. It's how we learn how to speak.
Mirroring is in all animals. It's a major part of parenting for all animals. It's how skills are imparted.
We decide who to mirror from in the first moments of our lives. In a process called imprinting it is decided what we should attach to and what we should imitate.
It is very easy for us to understand a sensory system that perceives and leads to an appropriate reaction. It is far more difficult for us to think of a sensory system that is set up just to copy.

So there is a kind of a contagion effect between animals. We are really attuned to what is going on for those around us. When we see something happening to them it is as if it is happening to us. This is not a human thing. This is an animal thing. It is turned on for certain in the start of our lives. It probably leads to automatic attempts to imitate for the initial parts of our lives. There is a positive feedback loop in this - we see, we imitate, we achieve, and we re-enforce the skill so that we can perform it without needing to see it all the time. Once we have learned we no longer feel driven to imitate but we still see and can still re-create that internal representation of what is going on for somebody else - it's just that we don't need to take it that far.