Prayer is request. The essence of request, as distinct from compulsion, is that it may or may not be granted. And if an infinitely wise Being listens to the requests of finite and foolish creatures, of course He will sometimes grant and sometimes refuse them.
Login to join the discussion