What do those three men have in common?
One is fictional. Two were ministers. The phrase “There but for the grace of God goes [name]” is associated with all three.
“But for the grace of God”? What does “but for” mean in that phrase? I’ll wager you’ve heard it often, and perhaps even said it, but what does it mean?
Modern syntax has “but for” meaning “however for” as in the statement “That’s fine for you, but for me it won’t work.” It’s a contrast. This, BUT that. That, BUT this other thing over here. The meaning in “but for the grace of God” isn’t a contrast, exactly; it means “except for” or “if not for.” “There but for the grace of God goes [name]” means “[Name] would be going there if it wasn’t for the grace of God.” (And where’s “there?” Usually somewhere unpleasant. Like the gallows, or perhaps the electric chair.)
Here’s another example: But for the wealth his family amassed years ago, he would be struggling with the rest of us. (If it wasn’t for all that money in his family, he’d be flipping burgers.)
If you want to get technical about it, here’s what the Merriam-Webster Dictionary of English Usage (1989) says about “but for”: “Except for functions as a compound preposition. Although it is found less often, but works with for in exactly the same way.” (page 213)
It’s interesting to me that Garner doesn’t discuss this particular construction, but he does talk about “but what/but that.” These are equally quaint-sounding. He says: “But that, the more literary of the two, is used today most commonly in negative constructions—e.g., ‘I do not doubt but that you are disappointed.’ Most readers would find the but in that sentence to be superfluous. . . .” (Garner, 2009, page 123)
If you’re curious now about compound prepositions, I’ll get you started here and here. Legal writing is rife with them, and that’s a main reason for the plain language movement. “For purposes of” means “for.” Write “for.”
NOTE: That second link includes phrases that are not precisely compound prepositions, but rather compound expressions. However, those two things are related. It’s worth knowing about them both.