It floats using the electricity stored in its body. When thunderclouds are around, Tadbulb will float higher off the ground.
How Tadbulb's in-game sprite changed across the main Pokémon games, from its debut in Generation IX onward.