Gambling is a very addictive thing to partake in. You either have self control and realize that you most likely are not going to win anything back, or you desperately keep spinning slot machines over and over again to try to pay your rent on your house (that you also gambled away). It is a hobby that has far more downs than ups.
Because of this psychological warfare of feeding into your addiction of chasing "easy" riches so long as you are lucky, gambling is thankfully banned for anyone that is below the age of 21, because we would not want any kids going into casinos and spinning slot machines. Well, apparently we do. That is why lootboxes exist.
Lootboxes are essentially slot machines in the form of packages in video games, where you turn the crank, hope for 777, but you end up getting nothing most of the time. However, instead of getting money, you either get that skin that you really wanted, or you get some random voice line that you already had.
They were majorly popularized by a game named Team Fortress 2, and they took off heavily because of it, until every company started using them for their microtransactions to some extent, whether it be for skins or for actual characters. Unfortunately, they have only gotten worse since.
Not only are lootboxes borderline predatory and also an annoying way to collect items in games, but they are a literal form of gambling. According to Oxford Dictionary, the definition of the word gambling is:
"The activity of playing games of chance for money, or of betting on the outcome of future events such as the results of races or games."
Lootboxes easily fit this definition, and therefore are gambling. This would not be a problem if it were only adults doing this (although it would still be annoying), however the real problem stems from the idea that literal kids play these games and often spend huge amounts of money on lootboxes.
There are multiple cases of kids dropping thousands of dollars on them, such as parents reporting their kids spending thousands of dollars on lootboxes, teens reporting spending hundreds or even thousands of dollars on lootboxes a year, and more examples discussed in the article below.
https://www.understandtech.co.uk/loot-boxes-gaming-spending/
And there are many more than this in other articles and other places on the internet as well. If anything, gambling with lootboxes can be worse than gambling with real money, because at least in traditional gambling you technically have a chance (however small) of making your money back or even winning a life changing amount of money. Lootboxes will almost always make you lose money because the rewards are usually cosmetic items.
First of all, there are many cases of kids spending extreme amounts of money on lootboxes, and those are just the ones that are reported. Even if the number was small, the number should be zero. These companies are feeding off the desire for instant gratification from kids, and they know they are doing it. That practice is inherently immoral, and there is no reason why a form of gambling should be legal to kids.
This does not really change the core problem. The fact that you can buy them (and these companies absolutely expect players to buy them) and end up spending thousands on one game is ridiculous whether or not you could have potentially earned them for free. It is still a business strategy built around gambling-style mechanics that target younger audiences.
It is also the reason why the "free to play" model is so popular. If this model did not work financially, games would still primarily be pay-to-play.
The key word here is some. The only games that typically allow this are on Steam, and even then a majority of games do not allow it. It is also not always obvious to players that they can sell items, since these options are rarely advertised clearly within the game itself.
To be frank, there is no easy solution to this problem. Unfortunately, lootboxes are such an effective way for companies to make money that many games continue to use them, and they likely will not disappear anytime soon.
The best advice for players is to simply avoid participating in them, or if you do participate, have strong self control. Vote with your wallet, protect your kids, and avoid falling into the addictive trap that lootboxes are designed to create.