Allied cryptanalysts succeeded over German cryptographers largely because of collaboration. It was not just one country working against the Germans, but the entire Allied powers.
The chain of collaboration began with the French: though they didn’t feel the need to pursue cryptanalysis of the Germans, they provided the initial information necessary to do so. After World War I, the French thought that further war was impossible, so when provided with Hans-Thilo Schmidt’s information on the workings of the Enigma machine, they passed them on to Poland. Poland did face an immediate threat, however, in the form of Russia. A Polish cryptanalyst, Rejewski, did much of the work at the front end of the effort to crack Enigma. His methods, when Poland suspected that they would no longer be able to continue covert cryptanalysis, were then passed on to England. Alan Turing and the others at Bletchley Park were able to use this information as a springboard for cracking the evolving Enigma.
Without collaboration, the decipherment of the Enigma would not have occurred, or at least not in the manner and order of events in which it occurred. The Polish would not have received an Enigma machine if the French had not given it to them, thinking that the Polish could better use the information. The Polish knew that they couldn’t continue cryptanalyzing, and instead of simply shutting down operations, they pass the information on, so that the final goal can be realized. If individual countries had cared more about their own fame than the bigger picture, the war might have ended drastically differently.