It's pretty much the same math behind weather prediction. Very roughly speaking, they have models to rank predictors (Or say, weather forecasting models) on accuracy and then figure out where the best predictors are all agreeing and the worst predictors are all saying the opposite of those best predictors.
It's worth noting that these prediction markets just run on blockchains, so pretty much anyone with the mathematical and technical knowhow can analyze those data streams and do much better than your average degenerate gambler who has no idea what they're getting into
Key is reconstructing the historical data from the smart contracts that run these things, that's a bit of a challenge but last I checked there's some companies which have figured this out [1]