The scariest, silliest, sugariest night of the year is finally here. Americans take their Halloween pretty seriously, even if many of us don't know exactly why we carve pumpkins, hang fake ghosts, hand out candy, or dress up like something dragged in by a graveyard cat.

As it turns out, we’ve been wearing Halloween costumes for nearly two millennia. But we've added plenty of modern twists to this ancient tradition.

To help you celebrate, we've summoned up that history, as well as a number of fun-size facts. (See cute photos of pets in costumes and more on the Nat Geo Kids Halloween Hangout.)

Pagan Progenitor

Archaeologists are still unearthing Halloween's roots at Celtic spiritual centers like the Hill of Ward (originally known as Tlachtga) in County Meath, Ireland. The holiday is descended most directly from the celebration of Samhain (SAH-win), the Celtic New Year observed between the sunsets of October 31 and November 1.

Halloween Special: Real-Life Zombies In a spooky coup, a parasitic worm hijacks a snail's brain and makes the snail sacrifice itself to a hungry bird.

On Samhain eve, at the death of another year, spirits (not to mention fairies, demons, and other creatures) were believed to walk the earth, traveling to the afterlife on a night when doorways between our world and the spirit world were thrown open.

Tradition holds that bonfires were also kindled at major sites like Tlachtga, where evidence of large-scale burning has indeed been found. These fires may have been used for sacrifices, or to symbolize the sun, since Tlachtga was known as one of the sun’s goddesses. (See pictures of crypts and catacombs.)

Celtic Costumes

Celts also began the Halloween tradition of wearing costumes, according to the American Folklife Center at the Library of Congress. The Celts donned animal skin to hide themselves from spirits, or they wore masks and blackened their faces to impersonate ancestors who had preceded them to the spirit world. (See how people dressed up a century ago.)

Revelers disguised as spirits are also believed to have gone from house to house engaging in silly acts in exchange for food and drink. These acts were possibly inspired by an earlier custom of leaving food and drink outdoors as offerings to supernatural beings. This likely inspired today's trick-or-treat traditions. (Read more on the first Halloween costumes.)

Putting the Christ Back Into—Halloween?

Christian leaders later transformed Samhain as they co-opted pagan holidays. In the seventh century, Pope Boniface IV decreed November 1 All Saints' Day, or All Hallows' Day. (Read about the most haunted places in the U.S.)

View Images The National Retail Federation expects many pet costumes this year, including hot dogs, lions, and pumpkins. Photograph by Jason DeCrow, AP Images

The church didn't attempt to do away with the celebrations, however. The night before Samhain continued to be observed with bonfires, costumes, and parades, but it was all rebranded with a new name: All Hallows' Eve, which later became "Halloween."

Halloween Arrives in America

European immigrants brought Halloween to the United States, where different Old World traditions mingled in America's cultural stew. The celebration gained steam with the explosion of Irish immigration to the United States in the 1800s.

It was only a matter of time before politicians got into the act. Anoka, Minnesota, may be home to the United States' oldest official Halloween celebration. In 1920, the city began staging a parade and bonfire to mark the day.

The celebration may have had another purpose, too. Anoka historians say townsfolk wanted to curb Halloween pranks that loosed cows on Main Street and upended outhouses, so the official celebration might’ve arisen in an attempt to promote good, clean fun.

Urban Legends, Poisoned Candy, and Killer Clowns

One of the most persistent urban legends claims that people hand out candy tainted by poisons, needles, or razor blades.

University of Delaware sociologist Joel Best, who conducts extensive research on tainted Halloween candy, says he's been unable to find even one substantiated report of a child dying or being seriously injured from eating trick-or-treat candy.

“Somebody gets a candy bar and sticks a nail through it and puts a picture up on their Facebook page saying, Hey, this is the treat that I got,” Best says. “And then eventually it gets debunked.”

Though these scares inevitably turn out to be hoaxes, Best notes, some years do bring new twists. In recent years, Colorado's legalization of marijuana caused some unfounded concern. “There was a fear that people would pass out edible marijuana and cause children to overdose,” he says, “which, among other things, completely ignores how much edible marijuana costs.”

In 2016, a rash of creepy clown sightings put trick-or-treaters on edge. But, as with other scares, it’s lacking in hard evidence. (See vintage photographs of eerie clowns from National Geographic's archives.)

“It reminds me of 1982 when the Tylenol poisonings occurred in September, and that led to a lot of speculation that there would surely be a lot of poisoned candy,” Best says. “There may be some clown stuff this year just because of the timing.”

But even creepy clowns aren't new, Best notes. “One of the things that surprised me is that this has actually happened before. It's just that this one, also, is amped up by social media,” he says. “There have been periodic clown scares not just in the U.S. but in European countries.” (Read about why clowns scare us.)

View Images Anoka, Minnesota, started holding Halloween parades in 1920. The tradition was one of the first civic celebrations of Halloween, and local historians believe it was an attempt to deter unofficial celebrations that sometimes led to cows being let loose or outhouses being toppled. Photograph by Elizabeth Flores, Alamy

Big Business

The Halloween may have originated as a religious and spiritual observance, but these days it's very big business.

According to the National Retail Federation's long-running consumer survey of American Halloween habits, 179 million U.S. consumers plan to celebrate Halloween activities in 2017, and they'll open their wallets in the process.

This year, seven out of every 10 Americans will hand out candy, while half will decorate their homes or dress in costumes. Total spending on decorations, costumes, and candy is estimated to reach a record $9.1 billion in 2017. That’s a consumer average of $86.13, nearly twice as much as the 2005 average, which was a mere $48.

Most Popular Costumes

Wondering who's most likely to show up at your door this year? Expect a nonstop parade of costumed kid crime fighters, according to the NRF survey. Princess costumes are this year's most popular costume among children, while both Batman and Star Wars characters also appear in the top five. Witches, Spider-Mans, and pirates will also be out in full force.

Nearly half of all adults plan to dress up this year; some several million witches are expected to be on the streets and in the skies this Halloween. Many of those adults surveyed also planned to dress as characters from the Avengers (sans Spider-Man), zombies, and pirates. (A new Google effort to chart trending costume searches, the Frightgeist, suggests we'll also see our share of Wonder Women, Harley Quinns, clowns, and unicorns.)

Even though many pets are less than enthusiastic about wearing Halloween costumes, their owners will be dressing them up whether they like it or not. Pumpkin, hot dog, lion, and pirate top this year's list of costumes for our four-legged friends. (Get trick-or-treat ideas that support National Geographic's Big Cats Initiative.)

Great Gourds

Far from the pumpkin's native roots of Central America, chilly Illinois produces most of the United States' pumpkins.

Illinois produced some 318 million pounds of pumpkins in 2015, followed by California, Ohio, Pennsylvania, and Michigan, the U.S. Department of Agriculture reports. Together, the nation's major pumpkin-producing states harvested almost 40,000 acres of pumpkins in 2015, a haul worth about $90 million.

More Than Costumes?

For almost half of all Americans, ghosts aren't just part of Halloween fun—they're real. Forty-two percent of Americans believe in ghosts, according to a Harris Poll of 2,250 adults surveyed in November 2013. The same poll reports that 26 percent of those adults believe in witches. (See 15 spooky houses for Halloween.)

A 2009 Pew Research poll reported that nearly 1 in 5 Americans, some 18 percent, said they have actually seen or felt the presence of a ghost.

Now that’s a scary thought.