For all the phrase sounds like something from the Rural South, the expression actually comes from Early American New England. It refers to how swine used to be raised by simply turning them out into a large (hopefully) enclosed area, and letting them “root” for their food opportunistically, instead of feeding them, whether this food consisted of small game, insects, acorns, wild spinach (“pigweed”) or, their favorite food of all, nitrogen-rich sweet clover. (Which is what a pig is really happy rolling in, not…well, you know.) However, some young shoats probably still lingered by the gate, hoping for handouts, occasioning the remark “Root, hog, or die.” meaning “make your own way, I’m not helping you,” or in other words, you’re out of luck.
A pop song from after the Revolution mocked Redcoats marooned in the New World, who also wandered around looking for handouts, with the chorus “Root hog or die!”, and verses boasting
…