Some movies go out of their way to convince you to take them seriously. Sausage Party is desperate to make sure that you don’t. The movie’s opening minutes unleash a torrent of profanity and crude sexual jokes topped with a smattering of ethnic stereotypes, all placed in the mouths of anthropomorphic grocery items. If you think it’s hilarious to hear an animated hot dog with the voice of Seth Rogen slobber over the possibility of slipping into a shapely female bun, you’ve come to the right theater.

But if you can suppress the feeling that you’ve wandered into a clutch of sniggering teenage boys, something strange happens to Sausage Party: It starts to get smart—really smart. This isn’t an unexpected turn if you’re familiar with previous screenplays by Rogen and his frequent collaborator, Evan Goldberg, among them Superbad, This Is the End, and Neighbors 2: Sorority Rising; gross-out bro comedies that turn out to be heartfelt and thoughtful are kind of their jam. But when the main characters are bright-eyed cartoons who look like they just stepped out of an old-fashioned advertisement for theater snacks, the disjuncture is even more pronounced.

Sausage Party’s opening song-and-dance number (with music by Oscar-winning Disney stalwart Alan Menken) introduces us to this strange new world’s characters, as well as its governing philosophy. Beyond the supermarket’s doors, these mellifluous pieces of produce inform us, is the Great Beyond, a magical place where humans and foodstuffs live in perfect peace and harmony. When the gods—which is to say supermarket shoppers—take them off the shelves, the beaming products know they’re going to a better place. If they aren’t, how come no packaged loaf or deli meat has ever come back to say any different?

Eventually, Rogen’s Frank discovers the horrible truth about humans and food and further learns that the Great Beyond is a deliberate fiction cooked up by the supermarket’s oldest inhabitants, the nonperishables (a bottle of alcohol, a box of grits, and a Twinkie). Knowing they were doomed to a hideous and painful death wouldn’t help their less durable fellow products escape their fate, so why not cook up a comforting lie, if only to cut down on the screaming?

So far, so Richard Dawkins: This is the smug atheist’s take on organized religion as a palliative for the simple-minded. But knowing the truth isn’t good enough. (Fair warning: Discussion of Sausage Party’s ending follows.) When Frank tries to use his newly acquired knowledge to rouse the rest of the supermarket’s inhabitants to act, they reject him outright. He’s tearing down their ideology and offering nothing in its place, and they’d rather exist in a world with clearly defined rules and rewards. Given a choice between something and nothing, people will believe in something every time.

Sausage Party’s take on the importance of belief systems is sophisticated for any movie, let alone one in which a bagel and a lavash argue over which of them has the right to occupy the supermarket’s “West Shelf.” Christianity Today’s Alissa Wilkinson called it “a sort of anti-PC secular eschatology for a pluralist age.” It’s comparable to the shock of seeing The Book of Mormon and realizing that, for all their rationalist cynicism, Trey Parker and Matt Stone were still capable of recognizing that organized religion could be a profound force for good. But given that R-rated animators have already made that point, Sausage Party has one more conceptual twist to come, and it’s a doozy.

After Frank convinces the food to take his side, they turn on the humans who have been consuming their kind for generations, and the revolution is anything but bloodless. It starts with an accidental death, one involving recreational drugs, a pot of boiling water, and a conveniently positioned broadax. But once an unlucky stoner has been decapitated by his would-be munchies, the Rubicon has been crossed. Breath mints and a bottle of soda join forces to burst one human like a fleshy balloon. When it’s all over and done, we see their dead bodies crammed into the supermarket freezers, their contorted faces pressed up against the glass.

The especially odd thing here is that the movie is on the food’s side, and so are we. We cheer the deaths of men and women, the gorier the better. The analogy to religious schisms drops away, and we’re left with a depiction—goofy, profane, and animated though it is—of the natural order rebelling against the scourge of humanity. From the food’s point of view, we are monsters, growing these sentient creatures for the sole purpose of grinding them between our teeth, and it’s only fair if they respond in kind. They try to enlighten us, using the stoner’s drugs to induce a hallucinogenic state in which the supermarket’s shoppers can perceive that the things they’ve been thoughtlessly consuming their entire lives have thoughts and feelings of their own, but this time it’s the humans who can’t handle the truth, and from then on, it’s all-out war—one whose first battle humanity loses in a rout.

At least the new Planet of the Apes movies are ambivalent about whether humankind should give way to a more deserving species: In Sausage Party, our time has come. (Call it Rise of the Planet of the Meats.) Not only do we heedlessly harvest the planet’s bounty to feed our own insatiable appetites, but then we watch movies about it and laugh at them. That’s right—not even the fourth wall can protect us. The planet is fighting back, and if global warming doesn’t get us first, canned goods will.