Parents stone on behalf of young children (completing their own first, then the child's); older children may throw themselves under supervision — many scholars advise leaving small children at camp for safety.
The stoning of the جمرات is one of the most physically challenging and crowded rituals of حج, and special consideration applies when children are involved. For young children and infants, the parent or guardian performs the stoning on their behalf. The guardian should first complete their own stoning (7 pebbles at each pillar), then throw on behalf of the child (another 7 pebbles at each pillar). This is the position of the majority of scholars.
Older children who are physically strong enough and can understand the ritual may throw the pebbles themselves under close parental supervision. However, given the significant crowd density and potential for stampede risk at the جمرات bridge, many contemporary scholars and حج organizers strongly recommend that small children not be brought to the stoning area at all. The guardian can perform the stoning on their behalf while the child remains safely at the tent camp with another caretaker. This approach prioritizes safety, which is a fundamental Islamic principle. If you do bring an older child, go during the least crowded times (late afternoon or after Asr) and maintain a firm grip on them at all times.
Source: al-Nawawi, al-Majmu'; Ibn Qudamah, al-Mughni; al-Mawardi, al-Hawi al-Kabir