(Gross oversimplification but..) One seemingly innocuous bug deep in the encryption "library", that no letter could map to itself, plus a bit of social "engineering" in taking advantage of the fact that messages often included the same text (e.g. "heil hitler") often in the same position, with a smattering of German complacency and arrogance assuming that their machine was uncrackable.
Pretty funny that the lessons learned here are still relevant to this day.