STIs in children can occur through various means. In neonates, infections can be transmitted from the mother during childbirth. This can happen with infections like syphilis, HIV, and Herpes Simplex Virus. In older children and adolescents, STIs are commonly acquired through sexual activity, which may include consensual sex or sexual abuse.