That is just down to chance. I reckon it has more to do with genetics/hygiene and their school cohort. Also covid is going to skew this a lot! Not just the virus but the societal reaction to it, norms, etc.
Well, our pediatrician told us that breastfeeding milk brings more antibodies to the infants. That's one thing definitely helps with fending off minor illness.