What APR measures
The APR is the discount rate that makes the present value of every scheduled payment equal to the amount actually advanced to the borrower — the loan amount minus fees paid up front. That net amount is the cash you truly receive, and it is what the rate is solved against.
Because the same payments are discounted against a smaller cash amount, the solved rate is higher than the stated rate. The larger the upfront fee, the wider the gap, which is why two lenders quoting the same interest rate can have very different APRs.