Matthew 7:21-23 (ESV)
21 “Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but the one who does the will of my Father who is in heaven. 22 On that day many will say to me, ‘Lord, Lord, did we not prophesy in your name, and cast out demons in your name, and do many mighty works in your name?’ 23 And then will I declare to them, ‘I never knew you; depart from me, you workers of lawlessness.’
Matthew 12:50 (ESV)
For whoever does the will of my Father in heaven is my brother and sister and mother.”
Who is the one that does God's will?
Matthew 21:28-32 (NET)
28 “What do you think? A man had two sons. He went to the first and said, ‘Son, go and work in the vineyard today.’ 29 The boy answered, ‘I will not.’ But later he had a change of heart and went. 30 The father went to the other son and said the same thing. This boy answered, ‘I will, sir,’ but did not go. 31 Which of the two did his father’s will?” They said, “The first.” Jesus said to them, “I tell you the truth, tax collectors and prostitutes will go ahead of you into the kingdom of God! 32 For John came to you in the way of righteousness, and you did not believe him. But the tax collectors and prostitutes did believe. Although you saw this, you did not later change your minds and believe him.
The one who actually does it even if they initially say they won't. The one who does it is the one who turns the "I'll do it" into physical action. Not the one who says he will obey but never does. The one who does God's will is the one who believes in God and what He tells us and actually obeys God's instructions to us - God's word. Faith (belief and trust in God) and obedience working together. It all comes down to making a choice which involves our mind, our emotions and our will all working together towards choosing obedience to God's word over disobedience.
or click on Titles
John 6:39-40 (NET)
39 Now this is the will of the one who sent me—that I should not lose one person of every one he has given me, but raise them all up at the last day. 40 For this is the will of my Father—for everyone who looks on the Son and believes in him to have eternal life, and I will raise him up at the last day.”
John 7:17 (NET)
If anyone wants to do God’s will, he will know about my teaching, whether it is from God or whether I speak from my own authority.
John 9:31 (NET)
We know that God doesn’t listen to sinners, but if anyone is devout and does his will, God listens to him.
John 14:23 (NET)
Jesus replied, “If anyone loves me, he will obey my word, and my Father will love him, and we will come to him and take up residence with him.
John 15:10 (NET)
If you obey my commandments, you will remain in my love, just as I have obeyed my Father’s commandments and remain in his love.
Romans 11:22-23 (NET)
22 Notice therefore the kindness and harshness of God—harshness toward those who have fallen, but God’s kindness toward you, provided you continue in his kindness; otherwise you also will be cut off. 23 And even they—if they do not continue in their unbelief—will be grafted in, for God is able to graft them in again.
Romans 12:2 (NET)
Do not be conformed to this present world, but be transformed by the renewing of your mind, so that you may test and approve what is the will of God—what is good and well-pleasing and perfect.
2 Corinthians 13:11 (NET)
Finally, brothers and sisters, rejoice, set things right, be encouraged, agree with one another, live in peace, and the God of love and peace will be with you.
Galatians 3:11 (NET)
Now it is clear no one is justified before God by the law, because the righteous one will live by faith [belief and trust in God].
Ephesians 6:5-7 (NET)
5 Slaves, obey your human masters with fear and trembling, in the sincerity of your heart as to Christ, 6 not like those who do their work only when someone is watching—as people-pleasers—but as slaves of Christ doing the will of God from the heart. 7 Obey with enthusiasm, as though serving the Lord and not people,
Philippians 4:6-7 (NET)
6 Do not be anxious about anything. Instead, in every situation, through prayer and petition with thanksgiving, tell your requests to God. 7 And the peace of God that surpasses all understanding will guard your hearts and minds in Christ Jesus.
Philippians 4:9 (NET)
And what you learned and received and heard and saw in me, do these things. And the God of peace will be with you.
1 Thessalonians 4:2-5 (NET)
2 For you know what commands we gave you through the Lord Jesus. 3 For this is God’s will: that you become holy, that you keep away from sexual immorality, 4 that each of you know how to possess his own body in holiness and honor, 5 not in lustful passion like the Gentiles who do not know God.
1 Thessalonians 5:18 (NET)
in everything give thanks. For this is God’s will for you in Christ Jesus.
Hebrews 10:34-37 (NET)
34 For in fact you shared the sufferings of those in prison, and you accepted the confiscation of your belongings with joy, because you knew that you certainly had a better and lasting possession. 35 So do not throw away your confidence, because it has great reward. 36 For you need endurance in order to do God’s will and so receive what is promised. 37 For just a little longer and he who is coming will arrive and not delay.
1 Peter 4:1-3 (NET)
1 So, since Christ suffered in the flesh, you also arm yourselves with the same attitude, because the one who has suffered in the flesh has finished with sin, 2 in that he spends the rest of his time on earth concerned about the will of God and not human desires. 3 For the time that has passed was sufficient for you to do what the non-Christians desire. You lived then in debauchery, evil desires, drunkenness, carousing, drinking bouts, and wanton idolatries.
1 Peter 4:19 (NET)
So then let those who suffer according to the will of God entrust their souls to a faithful Creator as they do good.
1 John 2:17 (NET)
And the world is passing away with all its desires, but the person who does the will of God remains forever.
1 John 5:3 (NET)
For this is the love of God: that we keep his commandments. And his commandments do not weigh us down.
Question: "Does Matthew 7:21-23 mean that believers can lose salvation? How can a person perform miracles in Jesus’ name if Jesus never knew them, i.e. they were not saved?"
Answer: The two questions most frequently asked about Matthew 7:21-23 come about because the verses seem to contradict two strongly held beliefs—one cannot lose his salvation and anyone who performs miracles must be from God. As we will see, one of these beliefs is based on scriptural truth and the other is not. While the true believer cannot lose his salvation, not all miracles are performed by true believers.
Jesus is speaking here near the end of His Sermon on the Mount (chapters 5–7). Beginning in verse 13, Jesus discourses at length on the subject of true faith vs. false professions, using the technique of contrast and comparison. Verses 13-14 describe two paths on which people walk through life, the broad road that leads to eternal destruction and the narrow path that leads to eternal life. He introduces here the concept of the “many” and the “few” that He will return to in verses 21-23.
In verses 15-18, He again contrasts the two types of people by using imagery well known to those in an agrarian culture—sheep and wolves, grapes/figs and thorn bushes/thistles, good trees and bad trees, good fruit and bad fruit. Having established the idea of dichotomy in the minds of His hearers, He goes on to apply these truths to the spiritual state of all within His hearing. Jesus presents the two types of people who will come to Him on “that day,” meaning the last day, the day of judgment, the great day fixed by God and unknown to angels and men which will be terrible to some and joyful to others. All will be seeking to enter the kingdom of heaven, but some will be turned away and will react in utter confusion and disappointment as what they thought was their “ticket” to heaven turns out to be worthless. These are those who prophesied in the name of Jesus, meaning either foretelling things to come or preaching the Word in His name. They have even performed miraculous acts such as driving out demons and perhaps healings and other miracles, but all to no avail. But their works were done for their own glory, not His, and were nothing more than “filthy rags” (Isaiah 64:6). In contrast, those who will enter heaven will not do so based on their miraculous achievements and accomplishments or works of any sort, but solely on the basis of obedience to the will of God.
But who are these unfortunate people and how can they do miracles unless they are doing them by God’s power? We know several things about them from the text. First, we know there are many of them, because it is many who are on the broad road to eternal death, as compared to the relative few who have found the narrow path to eternal life. Second, they claim the name of Christ. These are not Muslims, Buddhists, or atheists. These are those who would gladly say, “I am a Christian.” They work their works in Jesus’ name. They pray and heal in Jesus’ name. They preach and teach in Jesus’ name. They build huge churches and ministries in Jesus’ name. They claim a relationship with Him. But they are none of His. In fact, He sends them away, not with commendation for their good works in His name (and many good works are done in Jesus’ name by false professors), but by disowning their every deed and word. He “never” knew them, nor did they ever truly know Him. They weren’t Christians who lost their salvation. They were never part of the elect of God, chosen before the foundation of the world (Ephesians 1:4), set apart and sanctified by the Spirit (1 Corinthians 6:11; 2 Timothy 2:21), and justified by faith (Ephesians 2:8-9). The ones Christ puts away from Himself with harsh words of condemnation, calling them doers of evil, never came to Him in faith, despite their outward good works and miracles.
Then if these do not belong to God and never did, how do we explain their ability to perform miracles? Can those who do not have the Spirit actually cast out demons and perform miraculous healings and spectacular signs and wonders? There are two possible explanations for the ability of the ungodly to perform such acts. One is that some miracles are done by the power of Satan and his demonic host. They are incredibly powerful beings who can manipulate physical elements to their own ends. Consider the power God allowed Satan to use to afflict Job—lightning, wind (possibly a tornado), and boils all over his body (Job 1:16, 19, 2:7). These are certainly miraculous events. Exodus 7 describes the magicians and sorcerers of Egypt whose “secret arts” impressed many, but clearly these were not men of God. In the New Testament, Paul confronted Elymas the Jewish sorcerer and false prophet, calling him a child of the devil, full of all kinds of deceit and trickery (Acts 13:6-11). So we see that not all miracles come from God and not all who perform miracles in the name of Jesus are truly His. He calls them evildoers because the miracles they perform have evil as their source. In fact, Jesus warned us to be on guard against their deception as the end times draw near (Matthew 24:24).
Second, there are times when God, in His sovereign will and for His purposes, will empower unbelievers to perform miraculous deeds. The prime example is Judas who, along with the other disciples, preached the gospel, healed the sick, cast out demons, cleansed lepers, and even raised the dead. There is nothing to indicate that Judas didn’t have the same power as the other eleven, although he was never a true disciple of Christ. He was a deceiver and the “son of perdition” (John 17:12). Yet God gave him the power to do miracles for His own glory and to accomplish His will.
Jesus goes on to describe those who will be able to call upon His name on the day of judgment. It will be those who hear His words and put them into practice, the same ones referred to in verse 21 as those who obediently do the will of the Father in heaven. True believers are the good trees that produce good fruit (Galatians 5:22-23), the true sheep who look to Christ, depend on Him, commit themselves to Him, trust in Him, and believe on Him for righteousness, salvation, and eternal life. These are the ones who will enter into the kingdom of heaven.
Recommended Resource: Eternal Security by Charles Stanley
GotQuestions.org, “Does Matthew 7:21-23 mean that believers can lose salvation?”, https://www.gotquestions.org/Matthew-7-21-23.html