Immunity and level of exposure are very tightly coupled. Children would ordinarily be exposed to a variety of viruses from birth. Most encounters with a virus happen at very low viral load (e.g. total number of virus particles you're exposed to). During lockdowns, the diversity of viruses that children were exposed to dramatically dropped. Newborns and young children were now only exposed to viruses that were already in their household. Hence, young children have likely developed immunity to a smaller pool of viruses.
Once lockdowns ended, they were then exposed to many viruses their immune systems had never seen. Some of these exposures would be at low viral load, giving them a chance to build immunity. Some of these exposures would be at high viral load, overwhelming their immune system and leading to illness.