In every possible state, an Enigma machine produces a permutation of the letters A to Z. And not just any permutation, but one that exchanges pairs of letters, for example in a certain setting it might exchange A and Q, B and F, C and R and so on. Such a permutation, which consists entirely of cycles of length 2, is called an "Enigma Permutation".
After transmitting a letter, the machine state would be changed in a deterministic way, so a different Enigma permutation was used. Importantly, a code cracker can be assumed to know all encrypted messages, because they were just sent over radio.
Rejewski's theorem says: "The composite of any two Enigma permutations consists of disjunct cycles in pairs of equal lengths". Since the total cycle length is 26, you might have for example two cycles of length 1, two cycles of length 5, and two cycles of length 7. Another quite simple theorem says that a permutation M and a permutation S M S^-1 have the same cycle characteristics.
For the first few years, every transmission started by setting the machine into a fixed start state (known to sender and receiver, but not known to the code cracker), then the sender would pick a random three letter code and transmit it twice, then sender and receiver would use that three letter code to change the machine settings. After that, each message was sent with different machine settings.
All machines sent the first six letters with the same permutations P1, P2, P3, P4, P5, P6. If the sender transmitted ABC ABC, and the receiver receives RST XYZ, then permutation P1 exchanges A and R, P4 exchanges A and X. The cracker knows R and X, but not A. But the cracker knows that the permutation P1 P4 maps R to X, because P1 maps the known R to an unknown A, and P4 maps the unknown A to the known X. If you receive enough messages, with different random letters ABC, you gather enough information to find the complete permutation P1 P4. Same for P2 P5 and P3 P6.
Now each of these permutations consists by Rejewski's theorem of cycles in pairs of equal lengths, with the lengths adding up to 26 or the lengths of one half of each pair adding up to 13. That gives a pattern; in the example above the pattern would be (1, 5, 7). And this pattern only depends on the initial rotor settings, it is independent of the plugboard (the second of the two theorems mentioned).
With the initial 3 rotors which could be installed in 3! = 6 orders, and 26 x 26 x 26 initial rotor rotations, there were 105,456 possible initial settings, each of which would produce 3 patterns for the permutations P1P4, P2P5, and P3P6.
What the polish mathematicians did was create an index: For each of the 105,456 initial positions they found over months work the 3 patterns associated with each position. And with that it was easy to find the initial rotor settings for a day after intercepting about 100 messages. Not all settings created unique patterns, but usually a pattern would be produced by one or very few initial settings. Some rotor settings are bad news; for example there are 313 rotor settings producing three pairs of cycles of length 13.
The plugboard settings could also be discovered: Knowing the initial rotor settings, we can determine the permutation P1' P4' that would have happened without the plugboard. We also have the permutation P1 P4 that was produced with the plugboard. These can be compared, and we have the same information for P2' P5' vs. P2 P5 and P3' P6' vs P3 P6. That was usually enough to determine the plugboard settings.
So initially the Polish were able to decipher messages by hand. This stopped working when the transmission method changed (no 3 letters transmitted twice) and when 3 rotors were replaced by 5, with 60 possible rotor choices.
Later methods were substantially based on guessing messages or parts of messages. Since the same initial settings were used over a whole day, if just one message was cracked, every single message for the day was cracked (if not, all the messages for the day were unreadable). A good source of messages that could be guessed were weather reports: Since they were not very secret, they would be transmitted through the country with an easily cracked code, so the exact weather reports could be recovered. The exact same messages were sent to submarines with the enigma code, so that was a good source for known message texts.
Later a fourth rotor was introduced for top secret messages. That would have been uncrackable at the time. Except the settings for the four rotor machines were the same as the three rotor machines with another ring in 26 possible positions. So after cracking the three rotor code, just 26 attempts were needed to crack the four rotor machine.