King David has been in distress. He knows what to do to cry out to God. He says: “Give me relief from my distress; have mercy on me and hear my prayer.” And “How long will you people love delusions and seek false gods”
I have heard people say, “The Holy Spirit is a gentleman, he only comes when invited.” Paul didn’t ask for this encounter with God, it was just Boom! Jesus did say how much more will I give the Holy Spirit to those who ask, but sometimes, God in his sovereignty just touches someone.
Prayer is powerful. When we pray demons flee. When we pray, God opens heaven and pours out blessings. When we pray, God changes things and we change too! God covets our prayers.
In the context of giving, praying and fasting he says go ahead and do these things. But if it’s done with a prideful heart, showing off in front of people, you’ve already received your reward. It’s important to see the message behind the text here. He’s asking the question, are you doing these things as a show for others to see? Or are you doing it truly because you have your heart in the right place.
God looks at our heart, and he also looks at our actions.