Demographic data in pediatrics is collected through various means, including birth records, healthcare surveys, electronic health records, and national health databases. These data sources provide valuable insights into the health trends and needs of children.