In secure rip mode it always does at least one re-read of each sector, so the minimum number of re-reads is one per sector.
The algorithm is: it reads a range of CD sectors, then reads the same sectors again. If the two reads result in identical data, it moves on to the next range of sectors. If the two reads are different, it re-reads the same sectors until it gets an identical match. If it doesn't get a match after 16 tries, it gives up.
The quality percentage is calculated like this:
Q = quality percentage
m = minimum number of sector re-reads (equals the number of sectors)
n = actual number of sector re-reads
Q = m / n * 100
Example:
A track has 1000 sectors, 900 sectors return good data on the first "re-read", 100 sectors require one additional "re-read" to return good data. So:
m = 1000
n = 1000 + 100 = 1100
Q = 1000 / 1100 * 100 = 91%
If there were sectors that never returned good data, the number of re-reads is artificially scaled up to make the quality percentage look a lot worse. So you see it's not mathematically precise, it's meant to give a subjective indication of the rip quality.
Since error reporting from CD drives is not very reliable, we don't use it. Therefore, the quality percentage only reflects the number of re-reads we do and does not include any information about what the drive itself may be doing underneath.