Prayer gives expression to two things.
First is a certain gratitude, a thankfulness for something that is not, necessarily connected to any particular event or circumstance.
An Israeli archeologist once told me that he had found some words cut into the stone wall of an ancient cave dwelling: “I thank the living God. . . .”
This was a spontaneous personal expression, like graffiti, without any connection to ritual or anything of a communal nature.
The other thing that prayer gives expression to is what is known as work, work in the heart.
This work, also called worship, is itself ritual, and not instead of ritual.
The Rambam asserted that prayer emerges from the Divine commandment, “And thou shalt serve (work for) the Lord thy God with all thy heart.”
In this worship as ritual, prayer is recited with the same intention as when the ceremonial sacrifices were done in the Holy Temple.
In the course of time, prayer as worship assumed psychological aspects, such as praise or supplication, which tend to become its finest expressions.
Nevertheless, work is still central, and this concept was later defined to the extent that the world stands on three things: Torah, Avodah (work), and kindness.
The word “work” as used here is very different, of course, from the term used by labor movements; its meaning is taken from the work of worship in the Temple, work that was considered basic to the continued existence of human society in a ritualistic sense.
Thus there is a ritual that is a physical act, like offering up a sacrifice, and there is a ritual that is work done in the heart.
The fundamental meaning of all ritual, however, is sacramental, that is, it is not connected with anything that one personally wants to say.
It has a formal structure, although one may add supplements for personal needs.
A person prays, not because he has anything particular to say to God at that moment but because he has to do God’s work in the world, and prayer as worship is an integral part of the ritual.
Prayer is thus the inner ceremony parallel to the outer ceremony of sacrifice.
–Rabbi Adin Steinsaltz