Children start touching and playing with their genitals from a very young age. At this stage children might touch their genitals simply because it feels nice and is a source of comfort. It is not connected to arousal or sexual pleasure. As children grow older, they might start touching their genitals for sexual pleasure and with the intent to orgasm.
