Regardless of the deity we may believe in (the majority do believe in a deity) when we ask “Does God answer prayer?’ we usually mean: does God answer prayer positively? Does God give us what we want? The fact that those of us who pray don’t always get what we pray for is used as evidence that God doesn’t exist.
But a sympathetic deity would hardly give us what we want all the time. Does a good parent always give a child what the child wants? (Candy five minutes before a meal? “No, of course you can’t have candy now. Wait until after supper.”)
What about those cultures preferring sons to daughters? Some couples no doubt pray for a son. Yet the conception of males and females remains the same.
Suppose all those prayers were answered positively? We have only to consider China, experiencing problems because their one child policy (recently abandoned) led to sex-selective abortions of daughters. Many young men now lack marriage partners. China may experience a labor shortage in the future as fewer marriages take place and fewer children are born.
A son may give a parent status or ensure better care in old age in some cultures. Individually, having a son may profit. For the community, however, too many sons may bring disaster.
Why would God give me something I ask for if it would harm others, i.e., the community?
God, it would seem, cares for the community as well as for me.