Assume a month to month mortgage. This is a simplification, but it will illustrate the point.
Borrow $100,000 at .5% a month. Make a payment of $1000 each month.
So, for the first month, it will cost you $500 in interest to borrow the entire balance for one month. When you make your payment, $500 goes to interest, and 500 goes to principal.
Your new balance is $99,500. Now forget about the past, forget about the future.
What does it cost you to borrow this amount for one month? $497.5 -- Leaving $502.50 towards principal.
On month three, we want to borrow $98,997.50 for a month at a cost of $494.99.
And so on...
Nearer the end of the loan, when you have only 10,000 remaining, the interest portion will be nearer $100 a month, meaning you're paying principle much faster.
In essence, the interest portion of the mortgage payment is the cost of borrowing the outstanding balance for 1 month. As the balance is (should be!) decreasing, so will the interest portion of the payment.
In reality, the interest is calculated on the opening balance every six months. (Canadian Banks - Fixed Rate)