I would say that anything using skinner's box style methods to encourage people to repeat an action, and when there is money involved in that process at all, for example if you can buy the results of the loot boxes or you can buy the loot boxes themselves, it's gambling.
Epic allowed you to purchase loot boxes and get a random chance to get the thing you wanted as a result.
If it's something you can't pay for and it's intended to be a part of the way the game works, it's not intended to push you into spending money or anything like that, that's fine. Loot boxes are fun at the end of the day. That's not what this was though, this was gambling.