School can be boring and a smartphone is just a too welcome distraction.
I don't think there is 1 rule that would be simply the best solution for every single kid out there. Understand your kids, how they approach learning, stimuli, how they react, how much patience they have (and encourage the good bits obviously). And adapt approach correspondingly, continuously.
But yeah giving small kids phones is a recipe for disaster, even static glowing screen is often more interesting to them than colorful books. Also, lead by example, kids want to mimmick their parents for quite long (usually puberty is stopping this). Same situation here btw (kids, 2 and 3 years old) and we talk about it a lot. We see around us some failures of unrestricted access to computers and phones, but without time machine its hard to say how things would be different without them
If you just hold it over their head, they'll go find some other kid whose parents' entire parenting philosophy is "give iPad". You should make sure to explain to them why you're restricting the tech (and be open if you think the kids are mature enough to understand). "You could download bad things that spy on you or get exposed to bad content - it even happens to a lot of adults" is a much better explanation than "ooo spooky bad stuff on internet".
My final suggestion, and what I wish my parents had done, is allowed me to use the internet freely, with supervision (and an adblocker). Instead of letting them go on YouTube or Reddit to watch random streamers, let (and encourage) them to try learning Spanish, Python, electronic music, whatever. It would have been extremely fun for me as a kid to learn about "advanced" stuff like coding actual websites or messing with the terminal instead of playing with the sanitized block-code websites. They'll also pick up useful skills in the process, and be entertained in a productive way. Much better than restricting or allowing everything imo.
Also, the fact that you're considering this makes you a better parent than half the population nowadays. Keep your kids from consuming garbage and they will thank you later!