IIRC, Mode 1 is similar to the original WW2 IFF (Identification Friend or Foe)which has 2 digits and therefore only 64 codes. It works on the same frequency as ATC transponders. Mode 2 has 4 digits and 4096 codes and is almost identical to ATC but uses a different frequency. Mode 3 is the same as ATC transponfers and has th ability to carry extra information such as Mode C - or altitude reporting. Mode 4 is encrypted and the codes can only be loaded with a data loader.
Typically, mode 3 will be used as the ATC transponder. Modes 1 and 2 are used for IFF purposes in tactical situations with possibly the squawk changing at regular intervals. Mode 4 is for tactical purposes and can give far more information than the other modes.
And a bit of SSR trivia - the wartime codename for IFF was "Parrot". Which is why when interrogated, it "Squawks".