Suppose that on 1/1/17 you buy a $1,000 par, 6% coupon, annual pay, 10-year bond for $929.76; this price corresponds to a YTM of 7%. Coupons are paid on 12/31.
On 12/31/17 you receive the coupon payment of $60 (= 6% × $1,000). The interest income you will show on your 2017 income statement will be $65.08 (= $929.76 × 7%). The amortization of the discount will be $5.08 (= $65.08 − $60.00). The amortized cost you will show on your 2017 balance sheet will be $934.85 (= $929.76 + $5.08); the difference of $0.01 is the result of rounding.
On 12/31/18 you receive the coupon payment of $60 (= 6% × $1,000). The interest income you will show on your 2018 income statement will be $65.44 (= $934.85 × 7%). The amortization of the discount will be $5.44 (= $65.44 − $60.00). The amortized cost you will show on your 2018 balance sheet will be $940.29 (= $934.85 + $5.44).
Great examples aside, what you really need to understand is why there is need to amortise the discount. And the reason is that the standards prescribe that the gain should be recognised over the life of the investment in a systematic manner. So instead of recognising the gain right away (or in the last period only), it should be amortised in a systematic way, so that each period you recognise a part of that gain.
This is because there will be various instruments with this treatment (obviously all companies financial instruments measured at amortised cost). For some of them you might have expenses to amortise instead of discounts (such as one-off fees when taking a loan), but the logic is the same, just you recognise part of the fees as an expense in each period instead of only at the start of the loan.