Matthew 6:6 (ESV) … “But when you pray, go into your room and shut the door and pray to your Father who is in secret. And your Father who sees in secret will reward you.”
Repeating the same words over and over (babbling) like a magic incantation will not ensure that God hears these prayers. The pagans (or Gentiles) focused on how they delivered their prayers, repeating the right words in the right order. They often repeated the names of their gods as a way to get a blessing (as in Acts 19:34).
Jesus was not condemning prayer any more than he was condemning giving in 6:1–4. In fact, Jesus encouraged persistent prayer (Luke 18:1–8) and soon would give a pattern for prayer (see 6:9–13). Instead, Jesus was condemning the shallow repetition of words by those who did not have a personal relationship with the Father. Jesus told his followers not to be like the pagans but to come to God as to their Father, bringing their needs. The believers did not pray to idols of wood or stone with incessant babbling. They prayed to the one living and true God who knew what they needed even before they asked! This does not excuse believers from prayer, but they needn’t spend a long time telling God their needs because he already knows. God doesn’t need our prayers; but he wants our prayers and knows that we need them.
If God knows what we need, why bother praying? Because prayer is not like sending an order form to a supplier. Prayer develops an intimate personal relationship with an abundantly loving God, who also happens to know us deeply. His knowledge of us should encourage us toward confident and focused prayer. A child may feel an immediate need for candy; a parent considers the child’s long-term needs. Stretch that parent’s concern and perspective to an infinite dimension, and there you find God’s loving care. Prayer does not beg favors from a reluctant shopkeeper. Prayer develops the trust that says, “Father, you know best.” Bring your requests confidently to God.