It's a relatively uncommon structure for gambling, and things that do work that way (like casual sports bets between friends) are often exempt from local gambling laws. Traditional sports betting was done directly between a gambler and their sportsbook of choice at whatever profit-maximizing odds the bookie chose.
In other parts of the world, betting exchanges like BetFair operate this way, but unlike Kalshi, there's no pretence that what's occurring is anything other than gambling, and they are heavily regulated like other sports betting operators.