It has to do with programming variables in the game code. For most variables on Game Boy games, the fewest possibilities for the variable is 256 (HEX 100), labeled 0 to 255 (HEX 00 to FF). This goes for most variables in Pokemon R/B/Y, including ones for all the Pokémon lookup slots. However, only 151 Pokemon exist in R/B/Y. So, if there are 255 possibilities, and only 151 slots were defined by the programmers, what do the other 104 slots have? Glitches. And so, MissingNo. was created.
When creating the map for what Pokemon will appear where in the game, the designers made a crucial error. The 1-square-wide strip of water on the right side of Cinnabar and Seafoam Islands was programmed to be a place where wild Pokémon CAN appear. However, they forgot to define WHICH Pokémon can appear there. What this means is that the previous settings for "what Pokemon can appear" will remain from the last location in which the player encountered Pokémon, meaning that if the player went to, say, the Safari Zone, and then came to this blank area, the player would still be encountering Safari Zone Pokémon.
However, this would still never yield encounters with glitch Pokémon. This is where the Old Man and his Pokémon-catching tutorial come in. For the purposes of the tutorial, the player's name is temporarily changed to "Old Man" while he demonstrates catching a Weedle. During this time, the name "Old Man" occupies the space where the variables for the player's name would usually be kept, and so the player's name must be moved someplace else during that time. What the designers chose to do was have the player's name stored in the place where the variables for which Pokémon can appear, and what the level those Pokémon will be, would usually be kept.
Normally, this would not present any problems, as this data would simply be overwritten the instant the player stepped into tall grass, or any other area with wild Pokémon in it. However, if the player instead, surfs along the Cinnabar or Seafoam coasts, the game will use the player's name to determine which Pokémon will appear, which causes a seemingly random mishmash of Pokémon at wildly ranging levels, as well as MissingNo., to appear. This explains why each player's experience with the MissingNo. glitch is different: Because each player's name is different.