From Pirkei Avot (5:19):

Anyone who has the following three traits is of the disciples of Abraham, our father. If he has three different traits, he is of the disciples of the wicked Bilaam:

The students of Abraham look at all things with a good eye, are exceedingly humble, and are meager in their earthly desires.

The students of Bilaam look at all things with a bad eye, are full of themselves and feel they deserve everything.

What is the difference between the disciples of Abraham, our father, and the disciples of Bilaam the wicked?

The disciples of Abraham eat in this world and inherit the World To Come, as it says, “I have enough to supply those that love Me, and I will fill their treasure-houses.”

But the disciples of Bilaam inherit Gehinnom and descend to utter destruction, as it is said, “And you, oh G‑d, will take them down to utter destruction. These men of blood and conniving—their days will be cut in half. But I trust in You.”

The question is well-known: Why does the Mishnah ask, “What is the difference between the disciples of Abraham and the disciples of Bilaam?” We have already been told—their characters are opposites. And also: Why must we be told that these go to the World To Come and these to Gehinnom? Is that any surprise for us?

The Baal Shem Tov answered all these questions by way of a parable:

A king had a son and desired that he learn all the subjects a prince must learn. He hired many tutors for his son, but the prince took no interest in any of these subjects. One by one, his teachers all abandoned him. All but one.

But it happened one day that the prince saw a young maiden and he desired her. Why? Only because she seemed so pretty. The young prince’s tutor protested to the king concerning this unfitting behavior of the prince. The king, however, responded that this was good.

“It is good that he has a desire for something,” said the king, “albeit a misdirected desire. Now we can steer him in the right direction.”

So the king commanded that the pretty maiden be brought to live in the palace. But first she was brought before the king in the royal throne room. There, the king personally instructed her, saying, “If my son tries anything with you, reply that you have no interest in him until he learns something.”

Which is just what she did. So the prince began to study. And once he had succeeded in one subject, she insisted that he must learn yet another subject. So the prince studied more. And so things continued until the prince learned many subjects and acquired great wisdom.

At which point the prince began to see that prettiness is not everything, that there are greater things to be desired, and that all this girl has is a superficial prettiness and not much else. Now he desired to marry a lady with whom he could share matters of wisdom, the sciences and fine arts.

So it is with all of us. We all begin with a crude nature and desires for things quite inappropriate. But that nature can be turned around for the good. The evil inclination within us can become a throne for the good. All that is required is a wise and patient teacher who has the insight to see the possibilities of the future that lie in the present, to see the good that lies latent in the bad—as did the king in this story.

Now we can understand the words of the Mishnah:

The disciples of Abraham indeed have a sense of pride that is essentially the same as the pride of the students of Bilaam. And the disciples of Bilaam also have a sense of inferiority. So, in fact, it is difficult to distinguish one from the other, and we must ask, “What is the difference?” For, indeed, superficially, they may seem very similar, driven by similar spirits.

To which the Mishnah answers: The disciples of Abraham, with the power of their worst traits of character “eat in this world”—rise higher and higher in this world in their spiritual standing until they “inherit the world to come.”

They also have stingy eyes, but they use that quality of stinginess to be satisfied with their bare material needs.

They also have a sense of pride, but they use it to take pride in their mitzvahs, as the verse says, “He lifted his heart in the ways of G‑d.”

And they also have a passion to acquire more and more, but they direct it toward attaining every spiritual delight there can be attained in the divine service.

Meanwhile, the disciples of Bilaam allow their worst traits of character to carry them lower and lower, and their potentially good traits to destroy them. Yes, even a good trait can destroy a person! How? Humility is a good trait, but the disciples of Bilaam, with their humility, claim that they are not worthy to study the deepest wisdom of the sages or fit to be involved in noble deeds.

Keter Shem Tov, siman 63. The explanation is provided in Ben Porat Yosef