"In one sense, evolution didn't invent anything new with whales. It was just tinkering with land mammals. It's using the old to make the new." 
- Neil Shubin, paleontologist.

What Neil Shubin says is true to some extent.  Whales evolved from land dwelling hoofed animals some 30 - 45 million years ago in a transition that took less than 15 million years.  Whales have retained some of their mammalian traits. They have lungs for breathing, they are warm-blooded and mothers give birth live and nurse their young
(Nummela, 2004).

Additionally, whales have evolved many traits that have never before been seen in mammals.  Along with evolving the necessary apparati for living in a 100% aquatic environment (except for the occasional breach) such as the migration of the trachia to the top of the head (blow hole) to the loss of a functioning pelvis and the development of fins and flukes, whales also had to develop a way to hear underwater.  Fossil studies have shown that in earliest whales (pakicetid) airborne sound was received through the ear in the same way land mammals receive sound, but lacked the sophistication to allow underwater noises to be transmitted. Sounds are transmitted through the air filled outer ear that causes the tympanic membrane to vibrate.  Vibrations are passed through a chain of small bones in the air filled middle cavity.  This system works in the air, but under water; the outer ear would fill with water, creating pressure on the tympanic membrane that hinders the ability to transmit sound.  Also, underwater sound would reach the ear by passing through the cranial tissue, a mode of hearing called bone conduction, which does not allow for directional hearing (Nummela, 2004).

Fossil records show a shift to bone conduction as whales evolved.  A loosely suspended centre of mass that could vibrate independently of the small bones in the middle ear formed.  This mass is called the melon in modern whales, a sac full of various lipids. The melon has led to enhanced transmission of bone conducted sound and has improved the whales ability to hear underwater sounds.