I like to think of cryptography as a game. There are two sides, and each must play offense and defense when necessary — offense being the cryptographers and defense being the cryptanalyst. Now in terms of World War II, the Allies succeeded because they made sure to play both offense and defense while the Axis powers failed because they only played defense.
Take the British for example. As Polish cryptanalyst Rejewski pointed out, Enigma had a weakness for being repetitive, and they exploited this weakness to the point that they could begin to decipher a few messages. It only took the creation a computer that could do this continuously to finally keep up with Enigma. All the while possessing great skill at cracking codes, the British also made sure their offense was good and had devised a encryption machine that was more complex than enigma — Type X. This meant that the British had an advantage on both sides, not just one. It should also be pointed out that the British formed a large intelligence network with the rest of the Allies that eclipsed that of lonesome Germany’s. Overall, it was only a matter of time before the the Allies were going to secure victory in Europe.
However, you do not have to stop in the European front to see how important it is to dominate both sides of cryptography. Another example of equal value can be seen with the Americans and their campaign in the Pacific against Japan. Similar to the Brits, the Americans also made sure to focus attention into both their encryption efforts and their code breaking efforts. Both of these resulted in the encryption mechanism, SIGABA, also said to be more complex than Enigma, and the cracking of Purple, Japan's encryption machine that is also said to be repetitive like Enigma. However, pay more attention to the American’s encryption efforts to see how they dominated the game of cryptography. In a change of direction, the U.S. Navy decided to incorporate the use of a minority culture’s language into their encryption efforts. This minority was the Navajo. Obscure to the rest of the world, their strange language proved to be unintelligible to the the Japanese and was the sole reason that the Americans secured many key victories across the Pacific.
What one should take away from World War II is that it is not good enough just to be an amazing cryptographer to win. One must also be both an amazing cryptographer and an amazing cryptanalyst.