Traditionally, every section of a story is narrated from the same viewpoint. For example, one chapter in a love story is told from the perspective of the boy, the next chapter is told from the perspective of the girl. Within each chapter, everything is told from the perspective of the same character, even if both characters appear in the same scene.
For example:
I went over to Peter and asked him, if he would come to my party. I felt very nervous. ← What Rose does is told from her perspective.
He replied that he would. He seemed happy about my invitation. ← What Peter does is told from Rose's perspective as well. His feelings are only told insofar as Rose can guess them from his facial expression and tone of voice. She cannot see inside his head.
Traditional narration does not switch to the perspective of another character within the same scene.
For example, this is traditionally not done:
I went over to Peter and asked him, if he would come to my party. I felt very nervous. ← What Rose does is told from her perspective.
I replied that I would. I was happy about Rose's invitation. ← What Peter does is told from his perspective.
The last example is of course a very clumsy one, intended to illustrate why switching viewpoints within one scene can be problematic. In the example, the reader will be confused about who is "I" in the second paragraph.
In a third person perspective, an omniscient narrator can look into everyone's head without that feeling clumsy or becoming confusing.
For example:
Rose went over to Peter and asked him, if he would come to her party. She felt very nervous. ← What Rose does is told from the perspective of the omnisicent narrator.
Peter replied that he would love to. He felt happy about Rose's invitation but already began to worry about what he would wear. ← What Peter does is told from the perspective of the omnisicent narrator. The omniscient narrator can see in the heads of both Rose and Peter and tell the reader what they think without this appearing confusing.
As both what Rose does and thinks and what Peter does and thinks is told from the viewpoint of the omniscient narrator, the narrative feels clear and unified. Everything that is told is told from the perspective and with the voice of the omniscient narrator. In this case the tone is neutral and objective.
Headhopping is when the inner voices of the different characters become apparent within the omniscient narrative viewpoint.
For example:
Rose went over to Peter and asked him, if he would come to her party. Oh god, she thought, what if he says no? ← We "hear" Rose's thoughts in her own words, not in the words of the narrator. That is, we are inside her head.
Peter replied that he would love to. He looked happy to Rose, but inwardly he already began to worry. What will I wear? I hope Rose won't be disappointed that I can't dance! ← The narration "hops" from Rose's mind into Peter's head.
You can avoid head-hopping by narrating everything, including the charaters' thoughts, from the perspective of only one narrator and in that narrator's voice.
In older, traditional works of fiction, there is (almost) no head-hopping. It was long considered bad style.
But in contemporary fiction, head-hopping, if well done, is perfectly fine. Many famous authors do head-hopping. The most popular example is probably Stephen King.
Still, you shouldn't just accidentally head-hop without being aware of what you do. Like all literary devices, head-hopping is best used intentionally, if at all.