Well, the S&P (assuming the S&P 500) doesn't represent the entire US economy, but 500 companies that represent, arguably, the "winners" of the US economy, so expecting them to grow 7% while the entire economy as a whole grows less is not unexpected.
How much of that is inflation? If, historically, GDP growth is about 3% and inflation is about 3%, and you're trying to invest in the strongest companies, is that how you get to 7%+?
how many companies lose money for a few years and fold? if the S&P is winners, then it is counterbalanced by all the bad investments, pre revenue startups, and other businesses which are losing money. balancing out to 3% is not impossible.