The same dichotomy appears in the Hebrew Bible:
Exodus 14:22 (NASB)
22 When Israel saw the great power which the Lord had used against the Egyptians, the people feared the Lord, and they believed in the Lord and in His servant Moses.
And then later in the Psalms we read:
Psalm 95:8-11 (NASB)
8 Do not harden your hearts, as at Meribah,
As in the day of Massah in the wilderness,
9 “When your fathers tested Me,
They tried Me, though they had seen My work.
10 “For forty years I loathed that generation,
And said they are a people who err in their heart,
And they do not know My ways.
11 “Therefore I swore in My anger,
Truly they shall not enter into My rest.”
These Israelites had "believed" but they did not enter the Promised Land "because of unbelief" (Heb 3:19); that is, "what they heard was not united with faith" (Heb 4:2). The idea here is not just the obvious declaration of personal faith with the mouth, but the subsequent testing which had revealed the latent hardened heart, which accused both Moses and the Lord of capricious motives for having saved the Israelites from the bondage of Egypt (to where they had desired to return).
Returning to the Book of John, the same latent hardened heart appears early in the Gospel account with regard to those who "believed."
John 2:23-25 (NASB)
23 Now when He was in Jerusalem at the Passover, during the feast, many believed in His name, observing His signs which He was doing. 24 But Jesus, on His part, was not entrusting Himself to them, for He knew all men, 25 and because He did not need anyone to testify concerning man, for He Himself knew what was in man.
"What was in man" was the latent hardened heart. Like the Israelites who had seen the miracles of God through Moses and who had "believed," so too many "believed" on Jesus because of his miracles (as the passage above notes). Judas Iscariot is one example of a disciple who had the authority to cast out demons and perform miracles of healing (Matthew 10:1), but who was at one and the same time "the son of perdition" (John 17:12), which in the Christian New Testament is a title only shared with the Antichrist (1 Thess 2:3) - "ὁ υἱὸς τῆς ἀπωλείας."
What demonstrates the latent hardened heart in those who "believe" are trials and testing. In the case of both Moses and Jesus, those who "believed" had taken offense at the calls for repentance and obedience (notwithstanding that divine miracles were prevalent and evident throughout, which were "believed"). In the case of Judas Iscariot, the latent hardened heart enabled the betrayal of Jesus.
John 13:2 (NASB)
2 During supper, the devil having already put into the heart of Judas Iscariot, the son of Simon, to betray Him, (emphasis added)
Satan exploited the latent hardened heart of Judas Iscariot, which led to Jesus's death by crucifixion. How many miracles had Judas seen with his own eyes, and so had "believed" on Jesus?
Rather than stand with Jesus and face the trials awaiting in Jerusalem (as the disciple Thomas had noted "let us follow him so we can die with him"), Judas instead initiated the deliberate offer to the enemies of Jesus to betray him. In this respect, Judas avoided the trials and tests through alignment with the enemies of Jesus. In other words, the trials and tests of faith had revealed his latent hardened heart, which Satan exploited.