Most people who have tried durian—a spikey fruit native to Southeast Asia, with a hard outer shell, and soft yellow meat inside—know it to be a contradiction. It smells like trash that’s been left out in the sun too long, but it tastes divine—both creamy and sweet—nothing like its scent suggests it will taste. Durian’s smell is notoriously pungent (it’s banned on the Singapore’s public transit system) but where doesn’t that smell actually come from? A team of scientists sequenced the fruit’s genome to find out.

Earlier this year, a study in the Journal of Agricultural and Food Chemistry identified the different chemical compounds in durian that give it such a distinct scent. In this study, published yesterday in Nature Genetics, researchers were actually able to find the source of the smell in the fruit’s DNA. They were also able to determine that durian is related to cocoa—the source of a much more beloved treat, chocolate.

As Popular Science explains, durian has multiple copies of the genes that are “responsible for creating sulfuric compounds.” Its DNA—more than any other fruit—is focused on creating its distinctive scent. How could the fruit benefit from such a strong smell? In the study, the scientists speculate that “dispersal vectors are odor-enticed primates rather than visually enticed animals.” Translation: The smell attracts primates, which disperse its seeds as they eat it.

Despite the fact that most people think it smells like sulfur or rotten eggs (the study’s authors call it “ sulfury and onion-like”) Durian’s nickname is still the “King of Fruit.” In Thailand, Kit Kat bars have been imbued with their flavor, and in China, the fruit is offered as a topping at Pizza Hut. It's always satisfying to crack one of nature's secrets, but no matter why durian stinks, people will always want to eat it.

This story originally appeared on Foodandwine.com.