It's pretty wild; at least in the cases of meta-markets like the "skin gambling" in Counter-Strike, that's widely accepted as gambling and disallowed (Valve moved to shut that stuff down, but did not make any meaningful changes to the in-game market itself as I recall). I do remember a case in Europe blowing up a while back though and EA specifically getting into legal trouble with its FIFA games, so I did a quick search which led me to this PC Gamer article from 2018:
https://www.pcgamer.com/the-legal-st...nd-whats-next/
Conversely, the regulation/legislation section of the wikipedia article on loot boxes seems pretty comprehensive:
https://en.wikipedia.org/wiki/Loot_box
It was the Netherlands and Belgium where this stuff was being challenged. EA did not accept the results of the Commission in Belgium but as per the wiki article they did eventually stop sales of the FIFA UT packs in 2019 after the Commission went to the courts to seek legal action against them. EA actually tried to sue in the Netherlands and lost their case (LOL). Also interesting to note that companies like Valve and Blizzard voluntarily modified their games in those regions in response to what was happening with EA (Valve patched them out, Blizzard removed the ability to buy them with money). Mostly, however, at least in North America/Europe, it seems no real legal challenges have been presented and the industry is merely recommended to self-regulate... which leads to rating boards like PEGI to declare that it's not up to them to determine what is or isn't gambling (LOL). The ESRB is more explicit in openly declaring them NOT gambling and using prior legal challenges to trading cards as precedent.
But worth noting that some Asian countries do also regulate to some extent, particularly China which bans the sale of "lottery ticket" items and passed legislation requiring games to display the payout rates of loot boxes and even modify algorithms to guarantee payout rates on rare items over a set amount of loot boxes(!). I didn't realize how different the experience for something like Overwatch is across the world as such but it's interesting to think about (you can buy loot boxes here, you can't buy them in the Netherlands/Belgium but you can earn them as in-game rewards, you can't buy them in China but you can earn them as rewards and the game is actually transparent about the percentage chances of finding rare category items per box with potentially modified algorithms for that market alone(?)).