The analysis listens for onsets: the instants where the sound changes sharply, such as a drum hit, a plucked string or the start of a chord. It measures how much the spectrum jumps from one moment to the next, which makes it sensitive to rhythm and less bothered by loud, steady sounds such as a sustained pad.
Rhythm is repetition, so the next step compares that onset curve with itself shifted by every plausible beat length. The shift that lines the curve up best is the beat period, and 60 divided by it in seconds is the BPM. Tempos near the middle of the usual range are slightly favoured, and the result is checked against half and double the speed, because a song at 140 BPM also lines up at 70. Finally the individual beats are placed on the strongest onsets that keep an even spacing.
Reading the confidence
A high confidence means the onsets repeat clearly and evenly, typical of dance, pop and rock. A lower one points to a song whose tempo drifts, a quiet or ambient track, or heavy syncopation; the number may still be right, but check it with the click.