People who are otherwise smart often believe dumb things. History is littered with them. Which is why appeal to authority should always be regarded with skepticism.
This prayer example illustrates a series of fallacies and human biases. Confirmation bias, survivorship bias, apophenia, post-hoc reasoning... many ways we know our brains trick us.
Try this pre-registered, with large numbers and control groups.
Or just read the literature from people who did. Prayer does nothing.