Are you familiar with the concept of total return? When you check the performance of the S&P 500, what you typically see is the price return or the change in the index value over time.
But that doesn't include dividends, which can make a big difference to your wealth. Total return measures how much you've earned from an investment after accounting for both price appreciation and reinvested dividends. Over long periods, reinvesting those dividends can significantly boost your returns.