many indigenous cultures rose and fell in the land now known as Mexico: the Olmecs, the Mayans, and the Aztecs were just some of these Mesoamerican civilizations that flourished for nearly 40 centuries.
Although there were several different civilizations rising and falling over those 4000 years, they all shared a common thread: a belief in the afterlife. When people died, they didn't cease to exist — instead, their soul carried on to the afterworld.
The belief in the cyclical nature of life and death resulted in a celebration of death, rather than a fear of death. Death was simply a continuance of life, just on another plane of existence. Dia de los Muertos history can be traced back to these indigenous beliefs of the afterlife.
Once a year the Aztecs held a festival celebrating the death of their ancestors, while honoring the goddess Mictecacihuatl, Queen of the Underworld, or Lady of the Dead. The Aztecs believed that the deceased preferred to be celebrated, rather than mourned, so during the festival they first honored the Angels, the deceased children, then those who passed away as adults. The Mictecacihuatl festival lasted for an entire month, starting around the end of July to mid-August (the 9th month on the Aztec calendar), during the time of corn harvests.
After the Spaniards conquered the Aztecs in 1521, they tried to make the Aztecs adopt their Catholic beliefs. They didn't understand the Aztec belief system and didn't try to. As Catholics, they thought that the Aztecs were pagan barbarians and tried their best to squash the old Aztec rituals and fully convert the indigenous people over to their Catholic beliefs… but they failed.
What they accomplished was more like a compromise; a blend of beliefs. The Spanish conquerors succeeding in shortening the length of the Mictecacihuatl festival to two days that conveniently corresponded with two of their own Catholic holidays: All Saints' Day and All Souls' Day, which take place on November 1 and 2 of each year.