Matthew 17:18-20
"Then came the disciples to Jesus secretly, and said: “Why could not we cast [the demon] out?”
Jesus said to them: "Because of your unbelief. For, Amen, I say to you, if you have faith as a grain of mustard seed, you shall say to this mountain, Remove from hence hither, and it shall remove; and nothing shall be impossible to you.
“But this kind is not cast out, except by prayer and fasting.”
Psalm 34/35:
"But my soul shall rejoice in the Lord; and shall be delighted in his salvation.
All my bones shall say: Lord, who is like to thee?
You deliver the poor from the hand of those who are stronger than he;
the needy and the poor from them that strip him.
“Unjust witnesses rising up have asked me things I knew not.
They repaid me evil for good: to the depriving me of my lifebreath.
But as for me, when they were troublesome to me, I was clothed with haircloth.
I humbled my soul with fasting; and my prayer shall be turned into my bosom.”
Daniel 9:3:
“And I set my face to the Lord my God, to pray and make supplication with fasting, and sackcloth, and ashes.”
Basically, we are penitent for our own sins, and we also pray and fast for the sins of those who are sinning against us. We beg for mercy with the acts of our bodies as well as with prayers from our minds and hearts.
Fasting is particularly associated with calling for justice. Pretty much all Indo-European cultures feel that if one has been wronged or is about to be wronged, one ought to fast and pray for justice. And honestly, if you’re severely wronged and upset about it, how can you eat and drink?
(Sometimes this got a little silly or strange, as in early Irish culture where a wronged person was supposed to come sit at the doorstep of the baddie and fast, and then the baddie was compelled to also fast or acknowledge that he was wrong, and so it kinda devolved into a fasting contest. But the Israelites didn’t do anything like that! Hunger strikes also draw on this broad tradition.)
But basically, if you’re serious about prayer and the problem is serious, Jesus says you need fasting too. He’s God! He ought to know!