People give chocolate to the kids as a kindness. It is more for the giver than the receiver, and the optics round it. the royals don’t want to publicly say any small gift they don’t accept, as it will be bad pr, and it’s a lovely tradition.
anything received will be handed over to an assistant who will spirit it away nd deal with it. They themselves, the staff, may eat it, who knows.
but the kids will be more than used to handing everything over, and won’t think twice about it. They will know to act delighted and never say, I’m sure they do get Cadbury’s and the like at home, but anything they consume will be provided by family, parents, school or other trusted and known sources.
and if they were my kids, I’d do the exact same thing, say thank you, be polite, act delighted, and quietly get rid. Because there is always a risk some nutter wants to and would try to hurt those kids. You’d have to be incredibly foolish if you were Kate or William to let your kids take chocolate from strangers and eat it,