To examine this question it seems best to consider my own experience.
My mother once told me that I used to masturbate when I was a baby. Of course I don't remember that, but this comment did perhaps make some sense of a fleeting thought I had when I first rediscovered masturbation at about the age of thirteen. "This feels like being a baby again," I thought, but I didn't know why.
But in the years before I rediscovered masturbation I had a strong interest and attraction to the opposite sex. I remember at the age of about ten enjoying seeing a scantily clad woman on television, and while taking a swimming lesson I felt an ecstatic feeling of excitement when I bumped into my busty young teacher and felt her soft breasts pressed against me.