For a Pokemon to know Egg Moves, at least one of the parents of the Pokemon must know an Egg Move. When the baby hatches, it will know that move.
The example Bulbapedia gives is that of a male Snorlax knowing Belly Drum breeding with a female Charizard. The Charmander that hatches will know Belly Drum (an egg move for the Charizard line), since the Snorlax parent knew it.
as @sumwun mentioned, Volt Tackle is an exception. It can be passed down if a parent Pokemon holds a Light Ball, but since the parent Pokemon doesn't necessarily have to know Volt Tackle itself, it doesn't qualify as an Egg Move.
If neither of the parent Pokemon know any Egg Moves, the baby Pokemon will hatch also without any Egg Moves.