To bring it back to the initial thought, brokenness presents a fork in the road, one direction leading away from God and the other to Him. Experiencing the pain of sin, the weight of futility, or the jolt of humility on the fork that leads to God evokes from us a need to cry out to God.
This is prayer!
Crying out to God is coming into His presence in full recognition that you need Him. It is a statement of faith that you believe He is real, that He cares, that He hears, and that He can help you. God yearns for our broken hearts to be given over to Him so that He can nurture us.
“The Lord is near to the brokenhearted, and saves the crushed in spirit” (Psalm 34:18). Why does brokenness draw us near to Him? Because we finally see that we need Him. We finally acknowledge that we want Him. We are testing our faith in Him, giving Him an invitation to show up.