The Gemara in Masechet Shabbat tells that a certain non-Jew came to Hillel and asked that he teach him the entire Torah while he stood on one leg. Hillel responded by teaching him one mitzvah from this week's parashah - Parashat Kedoshim: ואהבת לרעך כמוך - treat your fellow the way you would want him to treat you.
"Everything else," Hillel said, "is just commentary."
Hillel's comment to this gentile, that the most fundamental principle of the Torah is "Love your fellow as yourself," requires further analysis. At the end of Masechet Makkot, the Gemara states that the entire Torah is encapsulated by a single verse in the Book of Habakuk: וצדיק באמונתו יחיה - "A righteous person lives with his faith." According to the Gemara, the most basic principle of the Torah is emunah. How, then, could Hillel say that the most basic principle is ואהבת לרעך כמוך?
The answer, perhaps, is that faith indeed underlies all other mitzvot, as indicated by the pasuk in Tehillim, כל מצוותיך אמונה. And only with emunah are we able to fulfill the dictum of ואהבת לרעך כמוך. The Torah issues many interpersonal commands: לא תקם ולא תטור, לא תשנא את אחיך בלבבך and others. These are very difficult laws to observe. Even if a person humiliated us, caused us harm, made us lose our job, or did not invite us to his affair, we may not feel any animosity towards him, or take revenge in any way. Moreover, we may not even bear a grudge, and we must continue loving him as though nothing happened. The work Bayam Derech gives the example of a person who was building an extension to his living room, but the building extended slightly beyond his boundary. His neighbor contacted the authorities, and as a result the man had to tear down the extension. Several months later, the neighbor started building an extension to his home, and built past the boundary line. According to the Torah, the man is not permitted to report his neighbor to the authorities, and if the neighbor comes to ask for a favor, such as to borrow something, he is obligated to agree to do the favor.
We are also commanded not to feel envious of others. If a woman has three unmarried daughters over the age of 30, and her neighbor's two daughters, aged 17 and 19, are about to get engaged, she must feel happy for the neighbor's good fortune. We are born with a natural inclination toward envy, anger and stinginess, but one of our main jobs in this world is to perfect our middot and become loving, generous and forgiving. The way we achieve this is through emunah. If a person truly believes that אין אדם נוגע במה שמוכן לחבירו, that nobody can take what is rightfully ours, that nobody can take our money or disrupt our building project unless Hashem wanted this to happen, and it therefore must be for the best, then he will never feel anger or jealousy. He recognizes that העושר והכבוד מלפניך - only Hashem decides how much money and respect we will receive. David Ha'melech responded to the curses shouted at him by Shimi ben Gera by saying, ה' אמר לו לקלל - "Hashem caused him to curse," so he felt no anger. Likewise, Yosef told his brothers, לא אתם שלחתם אותי הנה כי האלוקים - it was Hashem who decided that he should be sold as a slave, and therefore he did not hold it against them.
Everybody's good fortune depends solely on Hashem, who has enough for everybody, and therefore nobody ever takes away from us something we are supposed to have. If He decided not to give a certain person what he sees other people receiving, then it must be that he is here to serve a different purpose. We are all given exactly what we need to achieve our goals. One person's children are meant to get married at one time, and another person's children at a different time. It is all dependent exclusively on Hashem's decisions.
These are the fundamental principles of emunah, and this the basic foundation of the Torah. And when we have achieved the great level of ואהבת לרעך כמוך, we know we have mastered emunah.

