Tempo detection is a question about repetition, not about beats. Where the energy rises is an onset; the interval those onsets repeat at is the tempo.
How the measurement works
Every 5 ms the spectrum is compared with the previous window, and only the bins that got louder are counted. That is spectral flux, and it marks the start of notes far more reliably than a level meter, which cannot tell a new note from a sustained one.
The flux envelope is then autocorrelated across every interval between 60 and 200 BPM. The interval that best matches the pattern against a shifted copy of itself is the tempo.
Confidence
The reported figure combines how strong the winning correlation is with how far it stands above the typical interval.
Music with a clear drum pattern reads above 80%. A live recording that drifts reads lower, and the tempo it reports is an average of a tempo that was never constant.
Half and double time
A steady pattern correlates with itself at half and at double the tempo, and both are musically valid readings. Drum and bass at 174 BPM is also 87 BPM to anyone counting on the half.
The candidate list shows the alternatives and their relative strength, so the choice is visible rather than hidden inside the algorithm.
Beat lengths
The table converts the tempo into the numbers other tools take.
At 128 BPM a beat is 468.8 ms, a 1/8 note is 234.4 ms, and a dotted 1/8 is 351.6 ms, which is the delay setting that makes a repeat land between the beats. The rate in hertz, tempo divided by 60, is what a tremolo or an auto-pan needs for one cycle per beat.
Where it fails
Rubato, a tempo change partway through, or a piece with no percussion will produce either a low confidence or nothing at all.
Classical recordings and ambient music are the usual cases. The measurement is not wrong there, the question is.