None of the people in your examples had to believe in the power of religion. They may have or may not have.
In the first one, the person decided he would accept whatever punishment or kindness the earthly authorities of the church would decide necessary. He just hoped that the priests, bishops or whoever, would be merciful to him. That quotation sounds like it’s describing something that happened at the era when the Christian churches had earthly political authority, which they don’t now.
In the second one, the people could have been complete atheist, devout Christians, or anything in between. In that situation, they had nothing, and they had to rely on the charity of the people at church in order to have food, clothing and shelter.
Note that we also say that people throw themselves on the mercy of the court. This means they admit to the judge that they are guilty, and then they hope that the judge will be merciful to them.