Prayer is one of the principal expressions of belief in Hashem. People are not perfect; they are flawed and long to improve themselves. They therefore turn to the Creator of the World in prayer.
Human imperfection is apparent on two levels. Most people only feel a need to pray to Hashem when their daily routines are disrupted. For example, when someone is ill or injured and his pain intensifies, when he understands that all the doctors in the world cannot guarantee his health and well-being, and only HaKadosh Baruch Hu, in Whose hands is the soul of every living thing, can cure him and grant him a long happy life – then he prays to Hashem from the depths of his heart to heal him. So it is, whenever a calamity befalls a person, his livelihood suffers, enemies rise against him, or his close friends turn their backs on him. He then understands how the good things in his life hang in a balance and he turns to Hashem to help and save him. However, when daily routines function in their usual proper manner, most people do not detect anything missing and generally do not feel a need to pray to Hashem.
Those who delve more deeply understand that even their everyday lives are not perfect. Even when they are healthy and earning a steady income, their family life is good, their friends are loyal and the situation in their country is stable, even then, perceptive people sense their existential inadequacy. They know that their lives are limited and even if all goes well, there will come a day when they die of old age. Now, too, when they are young and strong, they are unable to comprehend everything in their lives, and not everything turns out the way they intended. They cannot achieve all of their aspirations or fully attain even one goal. Out of this sense of inadequacy, they turn to HaKadosh Baruch Hu, the God of the heavens and the earth, the only One Who can redeem them from their imperfection. By connecting with God in prayer, people begin the process of fulfillment and redemption.