He came from when the Japanese guy who developed the game was eating pizza. One slice was missing and he noticed it looked like a head with a mouth open. Originally he was going to be called Puckman but American merchandisers or whatever thought it would be too risque to use in arcade stores due to vandalism of going from Puckman to Fuckman.
That is how Pacman was born. Mrs. Pacman was made by college programmers when they tweaked the difficulty level, pattern movement of ghosts, and whatnot. To avoid legal conflict they put the bow on her head and all. It was so popular that it was eventually bought up by Pacman studio and they lived their lives on easy street.