The Mexican Revolution and the Cristero Rebellion both play a role in Juan Rulfo's novel Pedro Páramo, for they provide a backdrop and affect the characters and the plot of the novel. Let's look at how this happens.
The Mexican Revolution of 1910 touches the town of Comala, where the novel's characters reside when Pedro uses the upheaval to draw Susana San Juan and her father back to the village. Susana's father, Bartolomé, returns when the revolution disrupts his mining activities. Pedro has an ulterior motive, though. He knows that Bartolomé will eventually return to the mine, leaving Susana alone and vulnerable to Pedro's advances. When Bartolome goes back, Pedro has him killed.
The Mexican Revolution was supposed to be about helping Mexican peasants, like the people of Comala, gain rights and work toward prosperity. What it eventually encouraged was a move to cities. This migration out of rural Mexico left villages like Comala almost deserted.
The Cristero Rebellion also stands behind the story. It broke out in 1926 in protest of the secularization of Mexico and the government's attempt to suppress the Catholic Church. In the novel, Father Rentería, Comala's priest, leaves the village to fight in the rebellion, but in so doing, he leaves his people without spiritual guidance and without the sacraments of the Church. He thereby contributes to the spiritual unrest that plagues this literal ghost town, because his ideology (as well intentioned as it may have been) draws him away from the care he was to give his people.