Assimilation is a sound change in which some phonemes (typically consonants or vowels) change to become more similar to other nearby sounds. A common type of phonological process across languages, assimilation can occur either within a word or between words.
It occurs in normal speech but becomes more common in more rapid speech. In some cases, assimilation causes the sound spoken to differ from the normal pronunciation in isolation, such as the prefix in- of English input pronounced with phonetic [m] rather than [n]. In this case, [n] becomes [m] since [m] is more phonetically similar to [p]. In other cases, the change is accepted as canonical for that word or phrase, especially if it is recognized in standard spelling: implosion pronounced with [m], composed of in- + -plosion (as in explosion).
English "handbag" (canonically 'haendb{g) is often pronounced ˈhæmbæɡ in rapid speech because the m and b sounds are both bilabial consonants, and their places of articulation are similar. However, the sequence d-b has different places but similar manner of articulation (voiced stop) and is sometimes elided, which sometimes causes the canonical [n] phoneme to assimilate to [m] before the [b]. The pronunciations ˈhænbæɡ or ˈhændbæɡ are, however, common in normal speech.
In contrast, the word "cupboard", although it is historically a compound of "cup" kʌp and "board" bOrd, is always pronounced ˈkʌb@rd, never *ˈkʌpbɔrd, even in slow, highly-articulated speech.
Like in those examples, sound segments typically assimilate to a following sound, but they may also assimilate to a preceding one. Assimilation most commonly occurs between immediately adjacent-sounds but may occur between sounds that are separated by others.
Assimilation can be synchronic, an active process in a language at a given point in time, or diachronic, a historical sound change.
A related process is coarticulation in which one segment influences another to produce an allophonic variation, such as vowels becoming nasalized before nasal consonants (/n, m, ŋ/) when the soft palate (velum) opens prematurely or /b/ becoming labialized as in "boot" [bwuːt̚] or "ball" [bwɔːɫ] in some accents.