In his sermon "Abiding in Christ", John MacArthur says:
Some people would conclude that Judas lost his salvation, and that if any Christian fails to bear fruit, he also will lose his salvation. However, John 10:28 says, "I give unto them eternal life; and they shall never perish, neither shall any man pluck them out of my hand." The Word of God is absolutely clear about the security of salvation. In John 6:37, Jesus said, "All that the Father giveth me shall come to me." In chapter 17, He told the Father, "Those that thou gavest me I have kept, and none of them is lost, but the son of perdition" (v. 12). Those statements reveal that Jesus was not talking about a true believer who stops bearing fruit and loses his salvation. Rather, he is talking about a Judas-type of believer who is superficially attached to the vine, but never receives spiritual nourishment from it. Judas had a superficial relationship with Jesus, but he willingly walked away from that relationship and into the judicial condemnation of God. It seems natural that the allegory of the vine and the branches would come out of Christ's intimate talk with the eleven disciples who believed in Him.