How did sonic turn into a hedgehog?

Sonic was always a hedgehog.