I grew up in the fifties in a small town on the east coast of Ireland. Neither my family nor the wider community struck me, then or since, as especially pious; but religion was everywhere, and it was a religion in which the dead were more or less continuously present. Collection boxes stood at the back of every church for "the Holy Saints." The dead were remembered as part of every public prayer, even grace before meals, which always ended with petitions for eternal rest and light perpetual on the souls of the faithful departed. Our prayer books were stuffed with memorial cards, pious bookmarks whose stilted inscriptions and blurred photographs reminded us of the obligation to pray for departed friends and relatives. Every year at Easter we walked in a straggling procession the mile or more to the town cemetery for the annual blessing of the graves: the week before was a period of intensive clearing and tidying of family plots, in which it would be hard to say whether grief, devotion or the determination not to let the family down in front of the neighbors had the upper hand.
All Souls Day, on November 2, was not a holiday of obligation, but everyone with any pretensions to religion went to Mass, the liturgy notable for the somber black vestments in which the celebrant was swathed. The De La Salle Brothers who ran our local school explained that we could gain an indulgence which would release a soul from purgatory during every visit to a church that day, in the course of which we recited five "Our Fathers" and five "Hail Marys" for the pope's intentions. There was no limit on how many times this indulgence could be gained, so the pious or the elderly with a lot of dead friends and relatives could be seen going in and out of church all day long, chalking up indulgences, the wing-beats of the ransomed beating joyously about their ears.
Behind all this was a very clear geography of the afterlife, charting every detail of the fate of the departed. That geography had taken 1,000 years to evolve. There is little or no explicit mention of prayer for the dead in the New Testament, but invocations for the peace of the departed occur among the earliest Christian grave inscriptions, and the dead are commemorated in ancient liturgical texts like the Canon of the Mass. A few theologians, like St. Augustine and St. Gregory the Great, speculated about the existence of a state of painful purgation by fire through which the imperfectly or belatedly penitent must pass before they were granted the beatific vision but a full-blown theology of purgatory did not emerge until the beginning of the second millennium.
Here, as so often in Christian history, theory lagged well behind practice. The Western liturgy of mourning for and commemoration of the dead reached its decisive form not in the parishes or dioceses of the Church at large, but in the monasteries of the Middle Ages. There, in close-knit communities in which the memories of dead brethren were lovingly cherished, and in which there were large numbers of Religious and priests with time to pray, intercession for the dead came to be seen as one of the chief obligations - and benefits - of monastic life. Soon the lay patrons, benefactors and clients of the monasteries sought a share in this benefit, paying to have their names included on the lists of those prayed for in the monasteries, even acquiring graves in monastic precincts. The liturgy of the wider Church began to absorb and imitate the services of intercession for the dead evolved in the monasteries.
Alongside this liturgical and devotional development went a legal and theological rationale. How did prayer benefit the dead? Theologians elaborated the theory of a middle state between heaven and hell, in which all those who had died in a state of grace (but imperfectly purged of the aftermath of sin) would be cleansed and prepared for heaven. Sin repented of would not exclude from heaven, but it left behind an aftermath, a burden of damages or of "satisfaction" to be worked off in acts of penance - self-denial and self-punishment, charity to the poor, prayer.
But what of those who died with such penance incomplete? Purgatory was the answer to that question, imagined as a period of time granted or imposed after death in which the unfinished business of satisfactory penance could be completed. The prayers of those still on earth, and works of penance or of charity carried out on behalf of or in solidarity with the dead, could shorten this period of post-mortem penance, and this, it was thought, explained the Church's immemorial custom of praying for the dead.