Muscle grows from reps done while nearly all of its fibers are working. On a normal set that happens in roughly the last 5 reps before failure. So a set of 10 at RIR 0 scores 5, the same set at RIR 2 scores 3, and at RIR 4 it scores 1.
Turn on Rest-pause and enter two numbers: the activation set (taken close to failure) and the total reps of the mini-sets after it. The activation set scores as normal. Every mini-set rep counts, because after short rests the muscle is already fully working. RIR is for the activation set. The whole thing counts as one working set.
20–40 effective reps per muscle per session is a practical working range taken from programs that are known to work. It hasn't been measured directly. Start at the low end. Going past 40 mostly adds fatigue.
The full reasoning is in the Hypertrophy Hub.