“Is it prayer that is ineffectual, or the pray-ers?”
Remember the “serenity prayer”? One needs wisdom to know the difference between things that can be changed through prayer, and things that cannot. If people are praying for something that prayer can’t change, then of course they are going to be “ineffectual”. That doesn’t mean that either prayer itself or the people praying are ineffectual, just that they are not making a wise choice of what to pray about.
There is nothing that prayer can't change. Well actually prayer itself changes nothing. But God can change anything. Scripture says something to the effect of "You ask and have not because you seek to spend it on your own lusts."
Nobody controls God. He is sovereign. Nobody can tell Him what to do. But God hears the prayers, and He acts according to His will. Sometimes he modifies his will in response to prayers.