A discontinuity in an HLS stream means the player must reset its decoder state across the boundary — the timestamps in the next segment do not continue smoothly, the codec parameters might change (different SPS/PPS for H.264, different moov for fMP4), and the audio track might have a different sample rate or channel layout. The #EXT-X-DISCONTINUITY tag warns the player so it can flush its decoder, fetch a new initialisation segment if needed, and resync to the new timeline.
The most common cause is server-side ad insertion. When the SSAI server stitches an ad's segments into the live or VOD stream, those ad segments come from a different encoder with different timestamps and possibly different encoding parameters. The packager places #EXT-X-DISCONTINUITY before the first ad segment and another before the first content segment that follows. SCTE-35 ad markers in the upstream feed drive these placements.
Discontinuities also appear at programme boundaries (Channel A ends, Channel B begins on the same stream), at codec changes (HD content followed by 4K content with a different codec), and at recovery from upstream failures (encoder restart). Players that don't handle #EXT-X-DISCONTINUITY properly will glitch, freeze, or skip past ad blocks — a recurring source of QoE bugs.

