how does a fetish develop?
No one is born with a fetish. In fact, almost nothing is "innately" sexually relevant - at birth, the only thing that sexually arouses us is the sensations of our genitals.
So what happens is that from birth, our brains begin linking that sensation with external stimuli - the sensation of our genitals against our hands, the sights and smells around us, people, etc. Remember "classical conditioning" from your college psych class? Pavlov's dogs learning to salivate when a bell rang, because the bell was associated with food? It's like that. This process has actually been modeled in rats.
It often begins with "accidental pairings," butrepetition appears to be a key factor in the development of a fetish.
People with sexual fetishes often remember the fetish as beginning very early in their lives. Themost common fetishes, predictably, revolve around body parts (feet, specific bodily fluids, or particular body shapes being the most common), body modifications (tattoos, piercings), and objects related to parts (panties, stockings, shoes, etc), but may also involve your own behavior or others' behavior.
In some cases, it's also linking up sexual stimulation with activation elsewhere in the brain, including spreading activation, which is kind of a its own thing.
The process is different for male-bodied versus female-bodied people, since a male-bodied baby has this very obvious visual and tactile cue of their penis getting erect inside their clothes. Their brains link that erection to their internal state and to the external circumstances, creating this reliable feedback loop between body, brain, and environment. Without such a salient cue for arousal, the links created in a female-bodied brain are less strongly reinforced, and therefore more flexible.
(NB: This is not how sexual orientation develops. That's a whole other thing.)