The "no atheists in foxholes" is an adage that's meant to say that when people are in dangerous situations they turn to a higher power for help.
I recently realized that the expression is actually quite insightful, but not in the manner that believers think. It's pretty insightful in that it's saying that "God" is simply the product of fear, hopelessness, anguish and torment. It's the thing that human minds
come up with when they are in dire circumstances and extreme stress. A
hope spot which they wish might be true, that would save them. Nothing more.
This really digs into the psychology of theism.