How do index funds consistently rise when stock prices are supposed to represent future expectations

If the price of stocks aren’t a direct mathmatical representation of the objective monetary value of a company but rather the value including their future expectations, how does the S&P consistently go up about 10% per year. Wouldn’t this mean we’re consistently undervaluing the future of the market every year and then oh we’re surprised when these companies do good. I mean what are the chances the market does better than we expected, almost every year lol. Wouldn’t the market adapt and diminishing towards 0. i’d understand if it’s the first year the stock market existed and the gains were very volatile leading in this 10% increase. But shouldn’t we know better by know and have the models by now where the gains should be on average 0% and our future expectations would align with what actually happens. Or at least, some years it would go up like 2% other years down 2% but averages to about 0, instead of every year going up 10%. If it were actual expectations of the future, shouldn’t we be right about half the time wrong about the other half and the index fund should about break even or close to it every year. I’m just confused on how this is the case