If you’ve ever smoked weed, chances are you've felt pretty hungry afterwards. Maybe you even said, “I’m starving” as you plowed through a Nachos BellGrande, a Quesarito Combo, and a Crunchwrap Supreme.

Well, you were right—you were starving. Or at least, your body thought you were. And that's because of tetrahydrocannabinol, also known as THC, which is the main psychoactive component in marijuana.

A 2015 study conducted on mice by researchers at the Yale School of Medicine found that THC flipped a switch in the rodents' brain circuitry, making them feel hungry rather than full.

“By observing how the appetite center of the brain responds to marijuana, we were able to see what drives the hunger brought about by cannabis and how that same mechanism that normally turns off feeding becomes a driver of eating,” said Tamas Horvath, the study's lead author.

“It’s like pressing a car’s brakes and accelerating instead,” Horvath explained. “We were surprised to find that the neurons we thought were responsible for shutting down eating, were suddenly being activated and promoting hunger, even when you are full. It fools the brain’s central feeding system.”

Assuming that THC has a similar effect on humans, it's easy to understand how smoking weed would produce insatiable cravings for anything and everything.

But that’s not the only science at work when it comes to getting the munchies: THC also binds to cannabinoid receptors known as CB1s in the brain's olfactory bulb, making food aromas more intense, which increases your perception of flavor. So not only are you convinced that you’re ravenous, but things smell and taste better than they do when you’re not high, which is kind of a double whammy.

While this all may be a little annoying if you’re trying to cut back on your fast-food intake, the link between hunger and THC is potentially great news for people who have trouble eating due to illness or other medical reasons. For instance, marijuana has been shown to be an effective appetite stimulant in cancer patients. If researchers know exactly what causes that appetite surge, they may be able to use the munchies to benefit those who need it.