After a few weeks in a mystical den somewhere in deepest darkest west central Pennsylvania, a groundhog is imbued with certain magical talents which enable it to see future weather patterns.
Unfortunately, the effect of the sun’s juxtaposition with Pennsylvania interferes with the enchantment, since as we all know, any remotely decent enchantments are most powerful under cover of night. By casting his own shadow, the groundhog can recapture enough of the magic to predict a long winter, but when the spring is set to come early, the enchantment fades, and he doesn’t have to cast a shadow. Which is helpful, since as a general rule, groundhogs don’t like throwing shade any more than humans do, and if the winter is ending soon, the groundhog can switch to his regular job as a woodchuck, and get back to chucking wood at a generally unknown rate and quantity.
Technically, the enchantment could work on any mammal of the family Sciuridae, but squirrels and chipmunks simply don’t have the memory span to remember the spells, and thus it falls to marmot-kind to undertake this noble responsibility.