It wasn't until they were checking the urine samples of bearcats at a American nature reserve, that the team of scientists found what they where looking for. The team used a technique called gas chromatography mass spectrometry on the urine samples and found the chemical compound 2-AP which is the same compound found in popcorn that gives it its smell. The urine which is sprayed on the ground as well as on their own feet is used as a territory marker designed to ward off other bearcats competing for resources, and to attract potential mates.
Since the bearcat doesn't eat popcorn in the wild the team of scientist wanted to know how they made the 2-AP compound. They believe that there is certain bacteria in the bearcat that uses the urine as a source of nutrients. When the bacteria begin to break down the urine, they inadvertently produce 2-AP which in turn gives of the popcorn smell
Original source: http://phys.org/news/2016-04-chemical-compound-rare-animal-popcorn-like.html