The ancestors of whales and dolphins lost genes in the process of changing from land mammals to strictly marine mammals back in past generations. The amount of genes is an overwhelming number of around 236 genes that were looked at to be lost an/or missing. Researchers believe that these genes were lost when the process of land to water transition occurred over fifty millions years ago. Many of the genes that were lost had a good purpose to no longer be apart of the mammals genomic sequencing. One gene, called SLC4A9 regulates saliva production, which is not a bad gene to lose as a salt water mammal. This gene regulates saliva which whales do not need in order to break down their food, so this was a safe gene to lose. Not only do they not need this gene, but if the whales do not produce this gene that means they will retain more water due to less salt content located in their mouths. Another gene they have lost is a gene that regulates sleep, which is not needed as well due to whales not having to sleep for long, being that they only use one half of their brain to sleep.
This is an amazing process that occurs in living things in my opinion. When organism no longer need certain things they tend to get rid of it themselves and possibly grow new organelles or genes to help them in the future. This is a really crazy thing that occurs, and it makes me think as humans if this will be something that happens to us one day.