Whales are mammals, and it is believed that they were originally land animals that adapted themselves to the water when they went to the sea in search of food. Like us, whales have lungs instead of gills, and they need air to breathe. This means that they need to rise to the surface of the ocean frequently in order to take in oxygen from the air.
Baleen whales have two blowholes, unlike toothed whales.Blowholes are covered by muscular flaps that keep water from entering them when the whale is under water. In the relaxed state, the flap covers the blowhole.
The blowhole functions as a muscle, opening to allow air in. It leads to the whale's trachea, and then to its lungs. The whale exhales by spitting out air and water from the blowhole.