Most dolphins have a dorsal fin, the size of shape of which varies from one species to another. The likely purpose of this structure is stability in the water.
As far as we know there is no analogue in the terrestrial ancestors of cetaceans. As the dorsal fin has no bony support, it's not surprising that it is absent from the fossil record. And some modern species, such as belugas, narwhals, the finless porpoise and the right whale dolphin, lack this feature completely. Several of the river dolphins have only a slight ridge or hump. So a well-developed fin on the back may not be essential for cetacean survival.