How the 4 tones originated?
Old Chinese did not have tones but had consonant clusters, and a larger number of consonants.  It gradually lost consonants and simplified all consonant clusters to single consonants and had to disambiguate words by tone.