>>12645197There's an article on bulbapedia about it.
According to Chinese lore, some mountains are magical. If a carp makes it up a waterfall on one of those mountains, it's earned the right to be a dragon. (Chinese dragons look a lot differently than European ones) However, dragon powers are a responsibility, and if the dragon abuses its powers, it gets demoted to a flying lizard thing. That's the story of Gyarados, the bad-tempered serpent.