Likely correlation and not causation, Gambling addiction is just like any other addiction, and no one has answered the question of ‘why’ one becomes an addict. Most likely the causation is more closely related to the upbringing of the child, and the genetics passed down from the parents.
Except you actually sometimes get money back from the slot machine, with gaming lootboxes/gacha/microtransactions you're just getting imaginary digital goods that will disappear as soon as the company shuts down the game's servers.