That is, the sounds of words are stored in the brain as sequences of phonemes. Allophones are how we actually pronounce phonemes when we speak. Phonology studies the effects of neighboring sounds on phonemes and compares them across languages.
Assimilation means that one of the sounds becomes more like the other one.
You could also consider assimilation as the absorption of a feature from an adjacent segment. It is easy to see what happens when a phonological rule creates an allophone from a phoneme. The next question is how to we express these changes, maintaining the precision of description offered by phonetic symbols and features. The basic principle is that an allophonic rule describes the addition, deletion, or replacement of a feature of one phoneme when it is adjacent to another. Reading this rule is very simple.