Jack-o'-lanterns are named after the phenomenon of mysterious lights appearing over marshes and bogs, which are often attributed to supernatural or mischievous spirits. The name "Jack-o'-lantern" is derived from the term "will-o'-the-wisp" or "ignis fatuus," which refers to the flickering lights that were said to be caused by wandering spirits or goblins.
The specific association of the name with carved pumpkins illuminated from within is believed to have originated from Irish folklore. According to one popular legend, "Stingy Jack" was a clever but deceitful drunkard who tricked the devil on multiple occasions. When Jack eventually passed away, neither heaven nor hell wanted him, so he was left to wander the earth with only a burning coal in a carved-out turnip to light his way.
The Irish tradition of carving faces into turnips or potatoes and placing a light inside them to ward off evil spirits evolved into the modern practice of carving faces into pumpkins, which were more readily available in North America. Over time, the term "Jack-o'-lantern" became associated with these carved pumpkin lanterns, which are now commonly seen during Halloween festivities.