A bit of history: The first civil transponder was Mode A only and had only 64 codes (8 x 8). 4,096 Mode A codes came along in the mid or late 1960s. (8 x 8 x 8 x 8) Mode C was added separately; I believe after Mode A was expanded to 4,096 codes.
The Mode A transponder was an outgrowth of the military IFF developed during World War II.
Mode S came along much later and is much more sophisticated.
Mode A provides only position. ATC computers uses the change of position to determine ground speed. Tags added to the Mode A position tag, such a flight or registration number, etc, are generated by the ATC computer from flight plan data.
Mode C provides pressure altitude only.