Why do people "thank god" for saving life when it was the work done by doctors which made it happen?

Why do people

This logic always gets the people who believe in 'gods' somewhat triggered, but the fact still remains -- belief in something never ever seen is NOT factual.

Every time there is a destructive storm which is declared by religious types as "act of god", the people who survive or not suffer any damage will thank their imagined deity (there are many) for sparing them, but never giving thanks to the well trained crew that risked all to get to their location and pluck them from certain death?!

A scenario by a concerned doctor

Surgery to straighten the crooked spine of a child was successful, and people of faith gave God the credit, exclaiming, “Thank you God!”

“We prayed that God would guide the surgeon’s hands. We prayed the child would be strong enough to get through the surgery. We prayed for a successful recovery.”

But for most of human history — before back surgery existed — the options for believers’ responses to a child with Scoliosis were limited to statements like: “Things like this happen because we live in a fallen world.”

“Suffering builds faith.” “We’ll understand it better when we get to heaven.” “God works in mysterious ways.” Or simply, “We’ll be praying for you.” Such statements remind me of “the dog ate my homework” excuse.

I appreciate it when Christian friends and family say they are praying for me. I take it as an expression of concern and empathy. I understand that prayer often makes the person praying feel better. I understand that praying as a group may build a sense of community for those who participate. Having respectfully acknowledged that short list of possible benefits, I say prayer is an extension cord plugged into itself. I say, “Thank you medical researchers! Thank you doctors and nurses!”