How a fixed payment clears the balance
Each month your payment is applied interest-first: the month’s interest is taken off the top and the rest reduces the principal. Because the balance falls, next month’s interest is smaller and a bigger slice of the same payment goes to principal - so the balance falls faster the longer you keep paying.
On a $15,000 balance at 18% APR, a $450 payment pays about $225 of interest in the first month; by the final months most of the payment is principal. That acceleration is what makes a fixed payment far quicker than a minimum payment of a similar starting size.
Because interest is charged monthly on the balance, the walk runs one month at a time rather than through a shortcut formula that would need to hold for every balance and rate; the month is the same unit the statement actually uses, and the loop repeats until the balance reaches zero.