The apostles asked Jesus why they could not cast out the demon that possessed the boy. Certainly they inquired about this privately because of embarrassment over their failure.
The answer for their failure was simple - "Because of your unbelief" (Matt. 17:20). In order for one to work a miracle successfully, it was necessary not only to have a miraculous endowment, but also to believe that one could accomplish the task at hand. For example, in Matthew 14:28-31, Peter walked on water for a brief time and then sank as his faith shrunk. Evidently the apostles had spoken to this mighty demon in a doubting manner. This resulted in their power being weak, which made it possible for the demon to resist their commands.
"If you have faith as a mustard seed, you will say to this mountain, 'Move from here to there,' and it will move; and nothing will be impossible for you." The mustard seed was often used by Christ to illustrate that which was very little (cf. Matt. 13:31,32). Jesus stated that faith, even if it was very small, was basically without limits for those (like the apostles) who had been endowed with miraculous gifts of the Spirit.
Let it be understood that this promise was given specifically to the apostles. No man today has the power to perform miracles regardless of the strength of his faith. According to I Corinthians 13:8ff and Ephesians 4:7ff, the age of men performing miracles ceased when complete knowledge was given to the church through inspired revelation. This happened somewhere around 100 A.D. with the completion of the New Testament books. However, it should be understood that a lack of miraculous power does not make one helpless or weak (cf. Phil. 4:13).
Jesus also explained that "this kind [of demon] does not go out except by prayer and fasting" (Matt. 17:21). They had failed because of the weakness of their faith. In order to succeed, they must strengthen their faith through prayer and fasting. This would allow them to be able to fully exert the miraculous power that had been entrusted to them. If their faith was strong, no unclean spirit could defy them.
The wording here indicates that some demons were stronger than others and that this one was one of the worst (e.g., Legion, though great in number, didn't put up the fight this demon did; Legion begged for mercy, cf. Mark 5:9-13). This demon, on the other hand, was particularly willful and thus required a stronger faith to expel it.
There are many worthwhile tasks today that will never get accomplished for the Lord and His kingdom if we fail to cultivate a strong, resilient, unwavering faith. Prayer, fasting, and meditation upon the Scriptures will help greatly! God's people today can still move mountains, so to speak, if they put their faith into action and trust in the might of the Lord!