Phonology is the study of sound patterns in language and the rules governing the distribution of phonemes and allophones.