When I read about World War II, more specifically about the [use of cryptography](https://en.wikipedia.org/wiki/World_War_II_cryptography) in that war, I get the impression that the Allies were much more successful in breaking the enemy codes than the Axis Powers. Two such successes are particulary important: the breaking of the [Enigma](https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma) code by the Polish and the British and the breaking of the [Purple](https://en.wikipedia.org/wiki/Type_B_Cipher_Machine) code by the British and the Americans.

My question is: why were the Allies so much better here? Of course, a possibility is that they had a larger pool of highly skilled people. But is that all? Or is it also because their governments decided to bet more on that than the governments of the Axis Powers?

**Edit:** Thanks to the comments, I am now aware of some successes of the [German code breaking](https://en.wikipedia.org/wiki/German_code_breaking_in_World_War_II) and also of the fact that the Germans never had a central cryptography agency. But why is that? And what about Japan?