Prayer is considered avodah shebalev (service of the heart); therefore its essence is dependent upon kavanah (intent). There are two kinds of kavanah in prayer: one, a general kavanah, that the person praying is standing before the King of Kings and is filled with fear and love; and the second is a personal kavanah, that he concentrates in his heart on the words he is saying.
People are innately different from one another. Some can concentrate effortlessly, and though they repeat the same words every day, it is easy for them to recite all the words and mean them. Others, by nature, find it difficult to concentrate, and the more familiar a subject is to them, the harder it is for them to concentrate on it. Try as they might to have kavanah, their thoughts wander from one matter to the next. Despite great effort to have kavanah in Birkat Avot, their reveries take over, and to their surprise they are already saying Birkat Selach Lanu. Again, they attempt to concentrate for another berachah, but their minds fly off on another journey, and suddenly they find themselves bowing at Modim.
Even in the time of the Talmud there were Amora’im who complained about the difficulty of having kavanah while praying. The Yerushalmi (Berachot, chapter 2, halachah 4), teaches that Rabbi Chiya said of himself that he was never able to have kavanah throughout his entire prayer. Once, when he tried to concentrate during his prayer, he began to ponder who is more important before the king, this minister or that one. Shmuel said, “I counted newly hatched chicks while I was praying.” Rabbi Bon Bar Chiya said: “While I was praying I counted the rows of the building.” Rabbi Matanyah said, “I am grateful for my head, for even when I am not paying attention to what I am saying, it knows by itself to bow at Modim.” The commentary Pnei Moshe explains that these rabbis were busy learning Torah and therefore had trouble concentrating. In any case, we learn that it is difficult to have kavanah from the beginning of the prayer service until the end. Even though we must try as hard as we can to concentrate, one should not feel dispirited when he does not have the proper kavanah. Even a person who dreamt throughout most of his prayer should not despair; rather he should strive to have kavanah while reciting the remaining berachot.
A person should not say, “If I do not have kavanah, perhaps it is better not to pray.” The very fact that he came to pray before Hashem expresses something very profound – his sincere desire to connect to Hashem and to pray before Him. Every person is measured according to his nature, and at times, someone who finds it difficult to concentrate, yet struggles and succeeds in having kavanah for a number of blessings, is more praiseworthy than someone who easily succeeds in concentrating throughout the entire prayer service. Additionally, people who find it easy to concentrate on the routine prayers generally pray without any particular passion, even on special occasions, or when a tragedy befalls them. However, those individuals who find it difficult to concentrate on the routine words usually succeed in attaining higher levels of kavanah in exceptional circumstances.
It is said in the name of the Ari HaKadosh that kavanah is like wings upon which prayer soars heavenward and is accepted. When a person prays without kavanah, his prayer lacks the wings with which to fly upwards and it waits until the person prays with kavanah. When he succeeds in doing so, all the prayers that he recited without kavanah ascend to Hashem together with the prayer that achieved kavanah. The reason for this is clear: the very fact that the person initially came to pray demonstrates that he wants to connect to Hashem, praise Him, and asks Him for his needs. He simply failed to have kavanah. However, the moment he succeeds in having kavanah, he opens the gate for all his prayers to ascend.
According to halachah, anyone who has kavanah in his heart while saying the first verse of Shema and the first berachah of the Shemoneh Esrei fulfills his obligation, even if he does not have kavanah while saying the rest of his prayers (Shulchan Aruch, 63:4, 101:1; further in this book 15:6 and 17:9).