What causes whale mass strandings?

Around 600 pilot whales recently became stranded on a New Zealand beach, around 400 of which died before volunteers could refloat them back into the sea. Sadly, this kind of mass whale stranding has occurred since human records began, and happens somewhere in the world on a regular basis.