|An important point to note about many holidays is that they fall on or near the 4 solstices/equinoxes or at the midpoint in between. So, Halloween, variously called Samhain, and other names based on the pagan region that celebrated, falls at the midpoint between the Autumnal Equinox (around Sept 20th, give or take) and the Winter Solstice (Dec 21st, give or take). Of course, equinoxes have the day/night of equal length (12 hours each). Recall that when people did not have electricity or other modern comforts, and relied in a more direct fashion on what they grew for themselves, it was important to pay attention to these solar cycles.
So, after the Autumnal Equinox, the days become shorter and the night becomes longer, until reaching the Winter Solstice, when the night is longest and the day is the shortest. However, the Winter Solstice is usually considered a more positive time, because the days begin to get longer from that time. [The origin of Christmas is a different topic] So, All Hallow'sEve, is considered the darkest time... the days are getting shorter and shorter, and will continue to get shorter until the Winter Solstice, still a month and a half away. It was this growing darkness which associated that time of the year with the "spooky" feeling that Halloween is characterized by.
It was thought that during this time, the veil between the world of the living and the world of the dead was thinnest. It might be noted that not every pre-christian religion celebrated Halloween, nor was it always considered a negative time. Some felt it was an ideal time to communicate with dead relatives and revered ancestors. [Ancestor worship was common, and still is in parts of the world.] The tradition of wearing scary masks and costumes was developed, supposedly, to scare away the dead from the world of the living, and make them want to go back to the land of the dead. After all, who wants a bunch of dead spirits hanging around in the world?
Since most of these traditions developed long ago, often in cultures that did not have much literacy, it is probable that one cannot fully answer in a definitive sense what Halloween is, especially since there is so much regional variety to how it is celebrated. However, as Christianity spread across Europe, it was common for the Church to embrace popular holiday festivals and recast them in different light, rather than just fight against and suppress them. However, Halloween, along with maybe the Feb 2 divination tradition, is one of the most pure pagan traditions still going.
Hope this helps.