Although whales live in the water like fish, they are mammals. Instead of using gills to breathe like fish, whales use lungs to breathe like other mammals, which means they have to come up to the surface every once in a while to breathe. The lungs of whales are still relatively large, so they can re-submerge after a breath and not have to go to the surface to breathe very often. The nostrils of whales are very different from those of other animals. Their nostrils are on the top of their heads, right between their eyes, and some whales have two nostrils that are just combined. When breathing through the nostrils, a large amount of air will rush out of the nostrils, and a part of the sea water will be sprayed into the water, at this time, water spraying will occur.
In addition, when the climate is cold, if the air is colder than the whale's lungs, then the moist air will condense into water droplets after being exhaled, which will also form the phenomenon of water spraying. There are many kinds of whales, and different kinds of whales form different water columns in shape, height and so on. Blue whales, for example, can spray very high, even up to 10 meters high.
As mentioned above, whales spout water when they come out of the water to breathe. And because they can't breathe in the water, they have to pop their heads out to breathe at regular intervals. Different whales have different lung capacities, so they breathe at different intervals. Some of the smaller whales have to breathe every few minutes and can't submerge for long. But some species of whales can dive for a long time, such as sperm whales, which can stay in the water for an hour or two.