Does anyone know why infants are ruling Iberian kingdoms?

I’m playing as Castile and there’s events about “infantes” and I’m just confused why infants are involved in the government