Some men came to Jesus once with a question about what God required of them: “They asked him, ‘What must we do to do the works God requires?’ Jesus answered, ‘The work of God is this: to believe in the one he has sent’” (John 6:28–29). God wants us to have faith in His Son: “This is his command: to believe in the name of his Son, Jesus Christ” (1 John 3:23). Those who are born again by faith in Christ will produce good works to the glory of God (Ephesians 2:10).
When Jesus said, “I never knew you,” to the feigned disciples, He meant that He never recognized them as His true disciples or His friends. He never had anything in common with them nor approved of them. They were no relations of His (Mark 3:34–35).
Christ did not dwell in their hearts (Ephesians 3:17), nor did they have His mind (1 Corinthians 2:16). In all these ways and more, Jesus never knew them. Note that Jesus is not breaking off the relationship here—there was never a relationship to break off.