Intervocalic alveolar flapping (more accurately 'tapping', see below) is a phonological process found in many dialects of English, especially North American English, by which prevocalic (preceding a vowel) /t/ and /d/ surface as the alveolar tap [ɾ] after sonorants other than /ŋ/, /m/, and (in some environments) /l/.
The term "flap" is often used as a synonym for the term "tap", but the two can be distinguished phonetically. A flap involves a rapid movement of the tongue tip from a retracted vertical position to a (more or less) horizontal position, during which the tongue tip brushes the alveolar ridge. A tap involves a rapid backwards and forwards movement of the tongue tip. The sound referred to here is the alveolar tap [ɾ], not the flap [ɽ], and hence "tapping" is the correct term from a phonetic point of view (see also Flap consonant). The term "flapping" is, however, ingrained in much of the phonological literature, so it is retained here. However, no languages are known to contrast taps and flaps in the first place.
Flapping/tapping is a specific type of lenition, specifically intervocalic weakening. For people with the merger these following words sound the same or almost the same:
For most (but not all) speakers the merger does not occur when an intervocalic /t/ or /d/ is followed by a syllabic 'n', so written and ridden remain distinct. A non-negligible number of speakers (including pockets in the Boston area) lack the rule that glottalizes t and d before syllabic n, and therefore flap/tap /t/ and /d/ in this environment. Pairs like potent : impotent, with the former having a preglottalized unreleased t or a glottal stop (but not a flap/tap) and the latter having either an aspirated t or a flap/tap, suggest that the level of stress on the preceding vowel may play a role in the applicability of glottalization and flapping/tapping before syllabic n. Some speakers in the Pacific Northwest turn /t/ into a flap but not /d/, so "writer" and "rider" remain distinct even though the long "i" is pronounced the same in both words.
Flapping/tapping does not occur in most dialects when the /t/ or /d/ immediately precedes a stressed vowel, as in retail, but can flap/tap in this environment when it spans a word boundary, as in "got it" → [gɑɾɪt], and when a word boundary is embedded within a word, as in "buttinsky". Australian English also flaps/taps word-internally before a stressed vowel in words like "fourteen".
In many accents, such words as riding and writing continue to be distinguished by the preceding vowel: though the consonant distinction is neutralized, the underlying voice distinction continues to select the allophone of the /aɪ/ phoneme preceding it. Thus for many North Americans, riding is [ɹɑɪɾɪŋ] while writing is [ɹɐɪɾɪŋ]. Vowel duration may also be different, with a longer vowel before tap realisations of /d/ than before tap realisations of /t/. At the phonetic level, the contrast between /t/ and /d/ may be maintained by these non-local cues, though as the cues are quite subtle, they may not be acquired/perceived by others. A merger of /t, d/ can then be said to have occurred.
The cluster [nt] can also be flapped/tapped; the IPA symbol for a nasal tap is [ɾ̃]. As a result, in quick speech, words like winner and winter can become homophonous. Flapping/tapping does not occur for most speakers in words like 'carpenter' and 'ninety', which instead surface with [d].
A similar process also occurs in other languages, such as Western Apache (and other Southern Athabaskan languages). In Western Apache, intervocalic /t/ similarly is realized as [ɾ] in intervocalic position. This process occurs even over word boundaries. However, tapping is blocked when /t/ is the initial consonant of a stem (in other words tapping occurs only when /t/ is stem-internal or in a prefix). Unlike English, tapping is not affected by suprasegmentals (in other words stress or tone).