WASHINGTON >> It’s a trend that has surprised many: Why, despite being squeezed by high prices, have Americans kept spending at retail stores and restaurants at a robust pace?

One key reason is a relatively simple one: Wealthier consumers, boosted by strong gains in income, home equity and stock market wealth, have increasingly driven the spending.

That trend, documented by Federal Reserve research, represents something of a shift from the pre-pandemic period. And it suggests that consumer spending, the primary driver of the U.S. economy, could help sustain healthy growth this year and next.

Lower-income consumers, by contrast, have been disproportionately squeezed by higher-priced rent, groceries and other necessities, leaving them less able to spend on discretionary items such as electronics, entertainment and restaurant meals. Although their spending is starting to rebound as inflation-adjusted incomes rise, it could be years before their finances fully recover.

The disparities help explain the gap between gloomy consumer sentiment and widespread evidence of a healthy U.S. economy — a major dynamic in the presidential race now in its final weeks. Only a portion of the American population is fueling most of the growth evident in government economic data.

The trends also help illustrate how the economy has managed to keep expanding at a solid pace even though the Federal Reserve, until last month, kept its key interest rate at its highest level in more than two decades. Despite the much higher borrowing costs for mortgages, auto loans and credit cards that resulted from the Fed’s rate hikes, inflation-adjusted consumer spending rose 3% in 2022 and 2.5% in 2023. And it increased at a 2.8% annual rate in the April-June quarter, the government said last month.

The Commerce Department reported Thursday that retail sales in the United States rose 0.4% from August to September, a solid gain that suggested that shoppers are confident enough in the economy to continue spending freely. Restaurant sales jumped 1%, a particularly encouraging sign because it meant many felt they could spend on meals outside the home.