For centuries, kamikaze meant a storm that saved Japan. Its link to pilots came only at the very end of the Second World War.

The word joins two Japanese words: kami, "god" or "spirit," and kaze, "wind." Divine wind.

The wind in question struck in the 13th century. Kublai Khan, Genghis Khan's grandson, had become the first emperor of China's Yuan dynasty. He sent two fleets against Japan. Britannica puts the first, in 1274, at about 500 to 900 ships and 30,000 to 40,000 men. A typhoon sank roughly a third of the ships.

The second attempt, in 1281, was far larger. Britannica gives 4,400 vessels and some 140,000 men. On August 15 a great typhoon hit the fleet. At least half the invaders died, and only a few hundred ships survived.

The Japanese read the storm as help from the gods. Britannica says the name was coined for the 1281 typhoon, supposedly sent after a retired emperor went on a pilgrimage to pray for help. Modern historians still dispute the size of the 1281 fleet, and whether a typhoon really ended the 1274 attack.

In October 1944, Japan turned to the old story. At a meeting at Mabalacat airfield near Manila on 19 October, Vice Admiral Takijirō Ōnishi proposed special attack units to crash bomb-laden planes into Allied carriers. Their official name was Shinpū Tokubetsu Kōgekitai, "Divine Wind Special Attack Unit."

There is a twist in the reading. Shinpū and kamikaze are written with the same two characters. Shinpū uses the Chinese-derived reading, kamikaze the native Japanese one. Wikipedia says the Japanese press used kamikaze only informally during the war. After the war that reading spread worldwide and was reimported into Japan.

English picked the word up in 1945, according to Etymonline, and began using it as an adjective by 1946.

So a word that once stood for rescue now stands for sacrifice. The storm and the pilots share a name because the units were deliberately named after it.