First, let’s create a definition for “fetish” because the original idea with the word was that it was something that one needed to have present in order to achieve any sexual stimulation and satisfaction. Now, it’s very loosely used to mean something non-sexual that invokes sexual excitement (e.g. shoes, pacifiers, latex) to someone’s favorite “trigger” forms of eroticism (e.g. lingerie, exhibitionism, being forced to suck cock). I’m using the latter and most inclusive definition.
The connection between fetishes and their origin is not the same or clear for everyone. Some people may appear born with some of them; some seem to have connections between events that happened in their childhood (ranging from beautiful, loving experiences to traumatic ones); others seem to develop them spontaneously without a conscious connection; others intentionally explore certain physical, psychological, and emotional territories and they develop from there; some seem to emerge from watching porn (involving influential factors of fantasy, novelty, suggestibility, and/or exposure); some develop out of love (such as trying something because you are asked to do so by someone you love); and others seem to have no clear origin.
There is a lot of talk about fetishes developing from what’s called “conditioning” in psychology. There are two forms of conditioning: classical (think Pavlov) and operant (think Skinner). How these phenomena work is that our minds (and brains, neurologically speaking) learn to make associations between two things so that the occurrence of one triggers the other. For example, if a teen always waited until their parents went to bed before masturbating and their parents always went to bed at the same time and watched the news when they did, the teen might learn to unconsciously associate that particular situation and sexual arousal. So, later, when they hear the news on TV in another room, they may become sexually aroused and develop a “fetish” for listening to the news when they want to have sex. This is an example of classical conditioning. Operant conditioning, however, is consciously pairing a stimulus (e.g. spanking) as a reward or punishment in an attempt to shape behavior. This is a common tool used in BDSM (and the world, in general). Either way, there is a lot of emphasis placed on this idea to try to explain the origin of fetishes.
An additional factor which may make it more difficult to understand where these are coming from is that people tend to have multiple fetishes. Each of those fetishes can have a different etiology, and those different origins can conceivably influence one another, emotionally, psychologically, and neurologically. A man can be sexually aroused by putting on stockings and a garter belt and he may feel there is clear connection to when his older sister dressed him up as a little boy and how she’d tell him how beautiful he looked. He may also enjoy the feeling of being a cuckold for his wife. He never thought he would enjoy it, but his wife really wanted him to try it and when he did, and he saw her look of excitement, he began to love it because it made her happy. That same man may also love the idea of being forced to suck cock until he vomits. That one he’s not sure about because he just stumbled across some porn clips of it once and doesn’t understand why he wants to do it, he just knows it is very arousing to him. All of these man’s fetishes may have separate origins or may be directly related to single event.
Fetishes can also come and go (or cum and go, if you appreciate puns). Sometimes a person is very heavily interested in one activity or situation and will do it repeatedly until it’s exhausted and loses its excitement (likely due to some level of what’s called “habituation” and “desensitization”) and then move onto something else. That person may or may not come back to that fetish at some point in the future. Others may exhibit a steady, lifelong relationship to a thing or scenario, where it is never “outgrown” and abandoned. The reasons are likely some combination of brain wiring, conditioning, and/or neurochemistry (liking the “high” that accompanies the experience, for example).
Exploring fetishes and their connections can be fulfilling for some people. They may feel it helps them come to better understand themselves. It can also be useful if a particular fetish is upsetting for a person and they want to change it. Others couldn’t care less about why they enjoy being pissed on while wearing a tutu. All of this is normal!