That's how Game Freak made it. There are lots of strange things in Pokemon. Like a Togekiss that can know Fling when it has no hands or how Wooper can know Ice Punch when is has no arms.
His name is---- Natural Harmonia Gropius commonly known as N
Summary- Go ask Game Freak
Hope this helps =P