A transformation is taking place across North America. White, wriggly grubs about the size of a human thumb are walling themselves off inside rotting logs.

Over the next few weeks, these larvae will shape-shift into ponderous insects, whose males have a can opener for a forehead and a name previously owned by a Roman demigod.

Yes, we are talking about Hercules beetles—some of the largest flying insects on Earth.

While the North American Hercules beetles can reach three inches in length, it’s their southern cousins that truly impress, getting to up to seven inches long. The time-lapse video above, shot by insect hobbyist Hirofumi Kawano, provides a glimpse into the jaw-dropping journey each Hercules beetle embarks upon from grub to giant.

“Dynastes hercules, the Hercules beetle which occurs in Central and South America and the West Indies, is the largest scarab in the world," says Brett Ratcliffe, a scarab beetle expert at the University of Nebraska-Lincoln. (See amazing insect pictures.)

But to truly understand these insects and their heft, you need to watch the video.

“The larvae for those in South America are basically the size of a Polish sausage," says Ratcliffe.

Feces Chamber

Most people know some version of the caterpillar-to-butterfly metamorphosis story. But did you know beetles go through a similar, though slightly less palatable, transformation?

“A caterpillar will spin a cocoon out of silk that they make with their mouthparts,” says Gwen Pearson, an entomologist at the University of Purdue. “Beetles will basically create a chamber that’s like a cocoon, except that they build it out of soil and their own poop.”

In fact, Pearson says then when you see a picture of a massive beetle grub, about one-third of what you’re looking at is actually feces. (Read why insects rule the world.)

The larva stores its own waste to construct a pupal chamber, inside which it transitions into a hard-shelled beetle.

“They’re amazing,” says Pearson, who hatched some eastern Hercules beetles earlier this year. “They’re real-life Transformers.”

My, What Big Horns You Have

Scientists have been studying beetle horns for more than a century, says Ratcliffe, but there’s still much waiting to be discovered.

For instance, we know Hercules beetles use their shiny, scimitar-like horns to grapple with other males and fling them off trees—but the jousts aren’t over females, precisely.

Instead, the males appear to be vying for control of the best positions at a feeding site—such as a nice sap flow on a tree trunk or a particularly juicy piece of fruit.

Hercules Beetle These creatures are called Hercules Beetles for a reason. Some species can lift up to 850 times their own weight, which can help in competition for mating rights.

Of course, the females are attracted to food, too, so lording over a good spot helps the males fill their bellies and find mates. (Related: "Battle Ready: 5 Insects Prepared for War.")

Interestingly, even males who come up short in the horn department can still find a way to pass on their genes.

“When two large males are battling one another, you can have a sneaker male come in and mate with a female while they’re otherwise preoccupied,” says Ratcliffe.

Herculean Effort

With more than a dozen species and subspecies of Hercules beetle in the Western Hemisphere, the animals aren’t likely to disappear anytime soon. But they are getting more difficult to find in the wild. (Read about beetles that use booze-soaked trees to farm their food.)

Many invasive species in North America, such as the emerald ash borer beetle and the Asian longhorn beetle, target the same trees preferred by Hercules beetles, Pearson says.

Similarly, timber operations have reduced Hercules beetle habitats in both North and South America.