Actually, not all cats hate water. As a matter of fact, there are many kinds of cats that like to take a dip. Wild cats that live in hot areas, in particular, love to go into the water to cool off. Those that live in colder parts of the world tend to avoid getting wet. One possible reason is that wet fur will mess with their capability to maintain an acceptable body temperature.
As for house cats, they just get used to not being given baths. Cats groom themselves, unlike dogs, and cat owners do not really give their kittens a bath. If you start giving kittens a bath while they’re young, they will not hate the water at all.