This is where the principal (the amount borrowed) and the interest are repaid over the life of the loan.
The repayment period is established at the outset and as each repayment is made (e.g. monthly) the mortgage balance reduces and the interest on the loan is paid.
Over time, as the balance is repaid the interest may decrease and the proportion of each payment that is considered principal increases over time with repayments. So in the early years, more of the repayment is considered interest and in the later years, more is considered principal. This results in the debt eventually being repaid.