From pumpkins to pranks and communication with the dead, Halloween is a patchwork holiday stitched together with religious and occult traditions that span across centuries.

The history of this festival originates from the time of Celts, a collection of tribes with origins in central Europe. Their culture spread across the continent more than 2000 years ago. They used to celebrate the end of the harvest season with a festival called Soin on 31 October. It also marked the Celtic New Year and was considered a time between years, a magical time when the ghosts of the dead walked the earth.

Related: Origins of Scary Halloween Monsters

On Soin the villagers gathered and lit bonfires to drive the dead back to the spirit world and keep them away from the living, however as the Catholics Church’s influence grew in Europe, it frowned on the pagan rituals like Soin. Later in the 7th century, the Vatican began to merge it with a church-sanctioned holiday.

So 1 November was designated ‘All Saints Day’ to honour martyrs and the deceased (mostly for family members or friends). All Saints Day was known then as Hallowmas. Hallow means holy or saintly; hence it roughly translated to ‘mass of the saints’.

The night before 31 October was All Hallows Eve, which gradually morphed into Halloween. Celts believed that on the night of the 31st, the boundary between the living and spirit world becomes thinner.

The holiday came to America with the wave of Irish immigrants during the potato famine of the 1840s.

They brought along several of their holiday customs with them including bobbing for apples and playing tricks on neighbours like removing dates from the front of houses.

But where does the concept of spooky dresses come from? Well to avoid being recognised by evil spirits on All Hallows eve, the Celtics would wear spooky masks when they left their home at night, so the ghost would not mistake them for fellow spirits.

Trick and treating however originated in the second half of the 1930s. Americans took from Irish and English traditions and went door to door, asking for food or money, while dressed in costumes.

The term ‘trick or treat’ is thought to have come from the idea that families could prevent tricks from being played on them by treating kids with candies.

Another famous part of Halloween is the ‘jack-o-lanterns’, which people in modern times use on pumpkins. But, do you know pumpkins came long after the original jack-o-lanterns, which Celtics carved on turnips or potatoes. They did that to light the way to their home, for good spirits to enter.

Later, when the Irish immigrants entered America, they discovered the pumpkins to be the new face of Halloween.

Thus, while the festival originally used to be a solemn occasion limited to Ireland, the United Kingdom and Northern France, several people have begun to celebrate the festival in various parts of the world including India.