Casinos and human nature, plain and simple. Regardless of whether you consider lootboxes to be gambling, it's pretty plain to see that they play off of avarice and the joy of discovery and acquisition. I think one defense that people have for lootboxes is that, unlike gambling, even if you don't get something expensive you always get something, whereas with gambling you earn nothing if you lose and thus most people either get hooked by trying to make more after a taste of victory or the desperate, generally self-destructive pursuit to make back their losses.
Personally, though, I'd go the other way and say that lootboxes are more addictive simply because they don't play on negative emotions or have nearly as high a risk factor. As I mentioned, people love getting things, and because you can't get nothing out of a lootbox there's theoretically inherently no risk. Add in that lootboxes are cheap and there's no reason not to try one. Or two. Or seven. And so people are constantly drip fed these items of questionable worth and occasionally maybe possibly get the items they want- it really speaks more volumes than I can just how easy it would be for someone to get addicted or, scarier, someone to throw a ton of dough in without getting addicted simply because there's something they want and they just won't get it because, say it with me, RNG is bullshit.
That might seem a bit off topic but I think it feeds really well into the core question. If we're to look at the source, I've almost no doubt that gambling was the source for all this. That was the base, anyway, as what followed from there seemed to mostly be shaping and molding the idea into what it is today, with bigger players being Gacha, the introduction of DLC into gaming (and by extension, microtransactions), Lootcrate itself, and where popularity's concerned, Overwatch. It wasn't the harbinger of what was to come, it was simply the messenger- though one could say that thanks to how widely popular it was it played about as much of a role as any of the four big players I just mentioned.