The initial stages of prayer start with an egoistic self-seeking of desire for some benefit to be obtained from God. There is the consciousness of the limited human ego and an awareness of a great Power or Presence, and prayer acts as the medium of contact that is intended to bring about the result sought by the human ego. Yet it is possible to transform prayer into something purer and higher than this initial stage.
Sri Aurobindo observes: “…but afterwards we can draw towards the spiritual truth which is behind it. It is not then the giving of the thing asked for that matters, but the relation itself, the contact of man’s life with God, the conscious interchange. In spiritual matters and in the seeking of spiritual gains, this conscious relation is a great power; it is a much greater power than our own entirely self-reliant struggle and effort and it brings a fuller spiritual growth and experience. Necessarily, in the end prayer either ceases in the greater thing for which it prepared us,–in fact the form we call prayer is not itself essential so long as the faith, the will, the aspiration are there,–or remains only for the joy of the relation. Also its objects, the artha or interest it seeks to realise, becomes higher and higher until we reach the highest motiveless devotion, which is that of divine love pure and simple without any other demand or longing.”
As we see in the practice of Raja Yoga, that concentration on an object provides knowledge about that object, eventually ending in knowledge by identity; so too in the Yoga of devotion, prayer acts as the process that brings the consciousness of the human seeker into direct contact and relation with the Divine consciousness, and as the process deepens, the truth of Oneness replaces prayer with identity and the bliss of unity.
Sri Aurobindo, The Synthesis of Yoga, Part Three: The Yoga of Divine Love, Chapter 3, The Godward Emotions, pg. 543