Physical CCGs have always been on the nice side of a gray area, digital CCGs are worse, and most loot boxes are much worse. Some important differences (experience drawn from Magic: the Gathering CCG, Rocket League, Team Fortress 2, Hearthstone, Pokémon CCG, Hustle Castle, Merge Dragons, Call of Duty WW2, and a bunch more I don't remember off the top of my head; I play a lot of games):
Games with loot boxes will constantly push them: Throw a loot box in your face while you play or at the end of the match, urging you to pay to open them. What's inside? Maybe something cool? Don't you want to find out? They will also typically show that you have "(3) Unopened Boxes" in your account when you are in the menus. With a CCG, I can browse my collection, play games with friends, or even tournaments, without having to turn down constant sales pitches.
Games with loot boxes often remind you, while you play, that this and that player in your game or your friend X just opened a loot box now and got something cool.
Anything you want in a CCG can be traded or bought fairly from other players. Few loot box implementations allow this.
Any duplicates you get in a CCG can be re-sold, or given away. Few loot box implementations allow this.
Any cards you get from a CCG have a physical presence, so you can store them in a box in the basement and dig them out again years later to either play or sell. Most loot box games will be dead in 5 years.
Opening a loot box is instant gratification. One click and fireworks you have spent the money and it's opening. CCGs require either mail order or physically going to a store. The time delay between feeling the urge and getting the crackle kaboom whoosh (loot boxes opening is very showy) of opening the thing is days or hours versus split seconds.