Subjective: Besides learned associations that vary by individual and across cultures, there are some important genetic variants, too. I have the gene that lets me taste (smell) the sulfur-bearing compounds in many types of cabbage. Brussels Sprouts smell like rotten eggs, and broccoli is terribly bitter. But those who lack that gene taste it as
sweet.
Is that the supertaster thing? Broccoli is swet! Not like candy sweet but sweet.
There is also context and concentration. Think of analogy with sound: a pleasant warm tone in the background turns into a horrible distraction if the same sound is played loudly. People have mentioned cheese: One way of making cheese really does smell like rancid sweat, because it literally is the same substance. Bacteria create lactic acid, and this can be a sign of germs in one context, but the desired farmed species in another. So, to people who like that cheese, a low-level smell is appetizing. But a more intense smell, like opening the sealed package of cheese, can make one think of a gym bag that was left a week instead of having its contents washed right away.
My brother-in-law: Whoh, that smells like stinky feet!
(after eating made-to-order gourmet mini pizzas)
BIL: Got any more of that stinky-feet cheese?
Conversely, to a lover, a man's natural body odor can seem to include notes of cheese or milk.
There are a few smells that seem hard-wired; especially bad ones. Smelling salts can rouse a person to consciousness, even though he has no real-world experience with similar smells to form an association. People will instinctively keep their face away from various cleaning products.
Components in the smell of cooking meat (the
Maillard reaction) has been shown to stimulate certain brain structures associated with reward when viewed in fMRI, even among vegetarians who claim that meat stinks, and even when the isolated "notes" don’t smell like meat or bread or anything familiar really. The list on the page I linked here has a list of foods that have this, and you can suppose they all contain this same evocative sensation to some degree.
I'm super interested in this as the smell of meat (especially chicken, for whatever reason) has changed for me over the years. I used to think like, grilled chicken smelled good, even though I didn't eat it. Five or so years ago, maybe more, it started smelling NOXIOUS. Like it is absolutely stomach-churning, gag-inducing. Some cooking meat smells the same way, though sometimes grilling meat doesn't smell bad. I have wondered, as it is possible to lose the ability to produce enzymes that digest meat, that that process would then change your body's reaction to the smell of meat.
I wasn't eating it for years and years beforehand, and it smelled like 'regular,' and then suddenly, it was 'omg what is that smell, that's disgusting, omg' and it was cooking chicken.' So I think it has some biological base.
Other than that, the meaning of a smell is formed by association with experiences.
Another thing you should understand: people don’t have a conscious understanding of what smell is measuring, actually. With sound you have notes that vary by frequency; with vision you have R G B primaries that can combine to mimic the reading from some specific wavelength, and the colors that are perceived as different (rather than a sliding scale) are primaries and correlations between each pair of primaries. But smell? Each thing is simply different. It was only recently that researches figured out how the sensors measure specific fundamentals of electron vibration within the molecule; or rather, the part of the molecule in the way it fits in the reading slot. You
can combine primaries to mimic any given smell.
But that’s not really the point I’m going for. A specific smell is like a chord of music: several notes going at once. You can pick out different voices in a crowd of people talking at once, by paying attention to one. But humans are very poor at separating mixed smells. Dogs, on the other hand, are said to have a "layered" sense of smell because they
can.