I'm going to talk about human behaviour and evolution here. Remember my disclaimer! Don't commit the is-ought fallacy!
Go ahead. Go smell your significant other. I'll wait! Back. Smell good, don't they? Unless they're splitting wood, or something. Even then, I bet they smell better to you than anyone else while splitting wood.
This isn't a coincidence. Human mate choice is governed by quite a bit, and part of the `goal` is to mate disassortatively. That is, you don't want to mate with close relatives. Part of what helps you avoid inbreeding is MHC. Wait, isn't MHC the thing I mentioned earlier to help your immune system? It's the same! It also helps you pick mates. Versatile, eh?
We suspect MHC because of a few experiments. The first, by Wedekind et al. in 1995, had men wear t-shirts for two nights without washing. After that, the t-shirts were sealed in bags, and were presented to a number of women, who were to asked to rate the smells. Wedekind and colleagues collected the questionnaires, and some DNA from both the men and the women, to find out which type of MHC they had. They found that the women rated men with different MHC types as being more pleasant.
People were resistant to this study, because of the long-held wisdom that MHC was for the immune system only. Eventually, the study was replicated in Brazil by Santos et al. (in 2005), except using sweat directly instead. Critics cried that sure, there might be an inclination, but surely other factors weigh out in the final mate choice. Well, we have reason to believe these turn into actual matings - Ober and colleagues analysed marriage patterns in Hutterite communities and concluded that people tended to marry individuals with different MHC types.
Interestingly, MHC also seems to predict fragrence preference in perfume Milinski and Wedekind found that MHC type predicted the type of fragrance people preferred for themselves. This predictive power didn't hold over to preferences for partner fragrance. But this is, in a way, expected: for self, perfume is advertising one own MHC complement. For others, it doesn't matter what MHC they have, so long as it's different from your own.
Humans aren't the only critters who tend to marry/mate this way. Mice (Potts et al. 1991) tend to do that, as to Fat-Tailed leamurs (Schwensow et. al 2007), and fish such as Three-spined sticklebacks (Reusch et al 2001). There are many other species that have been studied, and this pattern found - though others where it hasn't. It's important to note the magnitude of the mate selection bias varies among species to levels difficult to detect.
It's worth noting that finding MHC disimilar mates is not a hard thing to do. If this was just to keep offspring MHC diverse, it'd probably be easier to pick an individual at random - they've got a low probability to be MHC similar. All human groups have a large amount of MHC diversity, and it's been well conserved through most human lineages. Truly, the only purpose this could serve is to avoid mating with those similar to ones-self - such as close relations. Today, avoiding inbreeding might seem trivial, but you don't have to go far back in human history to have a situation where two individuals don't know how related they are to eachother, because of incomplete genealogical knowledge. If you're a ground squirrel, life is even harder, knowing who your family is!
But if you're a ground squirrel, how are you reading this blog?
It's interesting to think that this is all going on without our being aware. Aside from some researchers, I don't think anyone out there is thinking, "Gosh, this person is right for me, because their MHC is clearly quite different from mine!" This is all going on inside our nose and brain without us even being aware of it. This is just one of many things we smell, but aren't quite completely aware of - the more we learn, the more it seems we're some of the worst judges of why we do things!
Bonus points to anyone who recognizes the movie clip. :)