the opening post is right about the mechanism and I think understates the practical bit.
Gradient slope is the single biggest driver of apparent purity differences. A shallower gradient over a longer run resolves more impurities and gives a higher purity figure. A steep gradient produces a tidier-looking chromatogram with fewer visible peaks and gives a lower purity figure. Both are legitimate methods and they will not produce the same number.