Basically apply the best practices that you had 25 years ago for TV (not too much, make sure it's not too much for their age, etc) and you'll probably be fine too.
In literature, such tricks can include a short episodic narrative that negates any need for long-term retention of information (short chapters). Reward centers of the brain are triggered by predictable plots. The reader feels smart when they are able to predict what it coming. Banal subject matter also helps get the product into the hands of kids (a book about a wizard school, or a game about farming rather than a casino). Then you wrap a community around the product. You give people the opportunity to advertise their participation and success with the product. You sell the knickknacks to display to their friends. Then you ensure the product has no end. You spread everything out over years so that, no matter how much they pay today, there will always be another purchase to make in the future.
Star Trek has been described as addictive, I think that can be extended to Harry Potter. I'd bet good money that Disney has people working to keep Star Wars as addictive as possible.
Except the problem these days is that algorithms are preying on human weaknesses and taking advantage of addictive characteristics. Things like video games and youtube videos are purposefully making themselves so addictive that it's different from before. I'm not one to say "this time it's different" but this time it really is.