Compound interest is calculated by applying the interest rate to the initial principal, which then accumulates interest over multiple periods. In this case, the interest is compounded weekly, leading to a significant increase in the future value over 20 years.