How compound interest is calculated
Each monthly contribution is added at the start of the month, and interest accrues on the balance at annual rate ÷ 12 per month. With monthly compounding that interest is added to the balance every month; with annual compounding it is added once every 12 months.
Example
Start with 10,000, add 500 a month for 20 years at 7% compounded monthly. You contribute 130,000 in total and end with about 302,370, so roughly 172,370 is interest.