Never worked for me that way, for one we found out how to find certain rares at that time, bought boxes (Second edition I think), got the good rares out, sold the rest packs.
It was more people buying boxes back then, opening, and selling the cards for profits (university mid 90s) than me buying lots of MTG in the hope to find something. We also played mostly with what we had, perhaps professional tournaments changed that.
Funnily, cards that people played back then, are worthless today, cards we considered average, are worth 1000+ EUR. Still have ~5000 EUR MTG cards somewhere.
CS GO lootboxes that then get adopted by the rest of the industry. I don't think it's because people like to gamble though, but rather that demand for cosmetics (especially in Asia) is more inelastic than thought so far greater profits can be gleaned then slapping a definite price tag.
TF2 had lootboxes ("crates") back in 2010, a couple of years before CS:GO was released - I think this was Valve's first major foray into them. And it was really easy to trade the items, or buy/sell them on the Steam marketplace.
I don't know how the relative market caps compared, but I remember reading years ago that a hat in TF2 had sold for $14k...
People probably not buying, but the most expensive item now on marketplace.tf is $9,499.99. Myself bought ~$200 cosmetics, mostly strange killstreak ones I play (Sheep with a gun).
But also never bought a key. Recently sold old loot boxes for $15 each, nice.
I always found it interesting that the older crates (or at least, some of them) sold for so much. I'm sure it's not unique, but the idea of selling the lootboxes themselves to other players doesn't seem like such a common thing compared to just opening them and selling the contents.
Team Fortress 2 had crates/keys before CSGO was released - but the blame definitely falls on Valve's shoulders in this timeline (I'm sure if Valve didn't create them in the popular form, someone at EA would have)
In east Asia, about 20 years ago with gacha games like Maple Story and slightly later with games that you'd play for free in an Internet Cafe, but would offer you loot crates. It became news in the west when EA took notice and added loot crates in FIFA 09, then TF2 famously was made free to play in order to hook more people in and push loot crates on them. It took off from there. Throughout this time there were Facebook games like this and eventually games like Puzzle and Dragons were pretty mainstream on mobile platforms by 2011.
Also of note, in many jurisdictions that regulate gambling, companies have found loopholes that offer arcade style "games of skill" that are still like 99.9% games of chance to get around gambling regulations. So gambling is also becoming more like gaming. It's enshittification all the way down.