An onset is the beginning of an event: the drumstick’s contact, the pluck, the consonant. Detection algorithms watch for the signatures of beginnings, usually a sudden rise in energy or a sudden change in the spectrum, the quantity called spectral flux.
The hard cases are musical reality: soft swells with no crisp start, dense mixes where events overlap, distorted material that is all edge. Detectors trade false hits against missed ones, and tuning that threshold is half the craft.
Onsets are the atoms of audio-reactivity. Kicks causing structural change, the rule Photism is built around, starts with the machine knowing precisely when the kick happened.