Asparagus pee (for lack of a better term) is a centuries-old problem, and scientists still aren't sure what causes its unique odor. Adding to the uncertainty is a strange phenomenon: a portion of the population either doesn't produce the smell or can't smell it at all.
Asparagus itself isn't smelly, which leads most to theorize that the odor comes from how it is broken down in the body. The key might might lie in a compound found only in asparagus, aptly named asparagusic acid. (Other than potentially making your urine smell, asparagusic acid does another thing pretty well: it keeps nematodes away.)
The theory goes that when the human body breaks down asparagusic acid, it releases chemicals that contain sulfur, the cornerstone of any awful stench - think skunk spray or rotten eggs. Those sulfur-containing chemicals are volatile enough to evaporate once we go to the bathroom, which explains the odor's speediness and sharpness - some smell a difference as soon as 15-20 minutes after eating asparagus.
The strange wrinkle in this theory is that certain people, about 20 to 40 percent, can't smell asparagus pee at all. On one hand, certain studies suggest that some people don't produce the odor at all. In other words, they break down asparagus differently than the rest. Other experiments claim that these people simply can't smell it, which is the most likely explanation. In fact, a study showed that test subjects could smell asparagus in the urine of those who couldn't smell it in their own (yes - try not to imagine that experimental set-up).
Some scientists have found a genetic link between those who can't detect the asparagus effect. The gene is located in a part of the DNA that affects the olfactory receptors, which are responsible for our sense of smell.
If you, like most people, are genetically "disadvantaged" in this case, seek solace in the words of Benjamin Franklin, pleading to the Royal Academy of Brussels in 1781 "to discover some drug that shall render the natural discharges of wind from our bodies, not only inoffensive, but agreeable as perfumes." Perhaps, someday, we can solve what he could not.