Magikarp and Splash are gimmicks... there is, however, a story behind them...
The origin of the Magikarp and Gyrados evolutionary line is that a carp (Magikarp) will become a Dragon if it leaps over the Dragon Gate - believed to be at certain waterfalls/cataracts - which would be seen as magic (Magikarp).
The move splash is how a Magikarp leaps over a Dragon Gate [Platinum: A MAGIKARP living for many years can leap a mountain using Splash. The move remains useless, though]. This explains why it splashes about for apparently no reason, as suggested in Silver [For no reason, it jumps and splashes about, making it easy for predators like PIDGEOTTO to catch it mid-jump] and Pearl [It is unable to swim against even slow-moving currents. It always splashes about for some reason], because it is desperately trying to evolve.
This may seem implausible because how can you use Splash to jump over mountains?
Well, the word Splash wasn't translated correctly from Japanese as it was actually supposed to be called Hop. This is why the only other Gen 1 Pokemon that can learn Splash are HOPpip, and its' evolutions.
This make make you wonder "why is Gyrados part flying but not part dragon?".
Gyrados was most likely not made a Pokemon with the dragon type as a water-dragon typing in generation 1 would be to over-powered with only one weakness - dragon. In the first generation there was only one dragon move - Dragon Rage - which will always only inflict 40 damage.
Not being part dragon, Gyrados was made part flying as that was the next best thing. This was likely to be because of Koinobori which are carp-shaped wind socks (like kits) that are flown across Japan on Children's Day (5th May), the last day of Golden Week, in honour of sons for a good future and in the hope that they will grow up healthy and strong. This is relates to the fact that Magikarp has grown healthy and strong.
Magikarp is a gimmick Pokemon - being so weak and having a move that does absolutely nohing - that is used to tell a story with a moral about perseverance. If a Magikarp perseveres then it will no longer be an amusing gimmick (a Magikarp) but a powerful Pokemon (Gyrados).
This is amusing at an opponents expense as a Magikarp's spalsh is now a Gyrados's thrash [Gyre - to thrash (Gyrados)].