From the Talmud
How do you conduct a dispute?
Mishnah, Yevamot, 1, 4:
Even though these consider the act forbidden and others consider it permissive, these invalidate and others permit - the House of Shammai did not refrain from marrying women from the House of Hillel, nor did those from the House of Hillel refrain from marrying those of the House of Shammai; All the purifications and impurities that were purified by one of these parties and were defiled by the other party - they did not refrain from purifying one on top of another.
The tradition brought in the Talmud explains why Halacha was determined according to the House of Hillel (Talmud Bavli, Tractate Eruvin 13:
The House of Shammai and Beit Hillel disagreed for three years. These say law is as we rule it, and these say law is we rule it.
A voice came out and said: These and these are the words of the living G-d, and the law is ruled according to the House of Hillel.
And since both groups' decisions are the word of the living G-d - why did the House of Hillel merit to have the law determined according to their opinion?
Since they were easy going and humble, and they would study their opinion and that of the House of Shamai, moreover, they would precede the opinion of the House of Shammai to their own.
Talmud Bavli, Tractate Baba Metzia, 49:
He said to them (Rabbi Eliezer): "If the law is as I rule it, this carob will prove." The carob was uprooted from its place to a distance of a hundred cubits ... They told him: "You do not bring evidence from the carob tree." He went on to say to them: "If the law is as I rule it, the aqueduct will prove it." The aqueduct shifted backwards. They told him: "You do not bring evidence from the aqueduct." He repeated to them, "If the law is according to my opinion, the walls of the academy will prove it." The walls of the academy tilted. Rabbi Yehoshua rebuked them and said to them: "If the Torah scholars argue with each other in Halacha, why do you get involved?" So the walls did not fall completely out of the honor of Rabbi Yehoshua and did not stand up erectly due to the honor of Rabbi Eliezer and they remained tilted. He went on to say to them: "If it is law is as I rule it, it will be proven from heaven." Then a voice called out and said, "How do you argue with Rabbi Eliezer, who's verdict is valid everywhere?" Rabbi Yehoshua stood up and said, "It is not in heaven." [A quote from Deuteronomy 30: 10-14: "... for this commandment, that I order you to fulfil today, is not wondrously remote from you, nor is it a distance. It is not in heaven... rather it is very close to you: in your mouth and in your heart, to carry it out. "].
What is – it is not in the heaven? [ what is meant by – it is not in the heaven?] Rabbi Yirmiyahu said: "Since the Torah was already given from Mount Sinai, we do not heed to a voice calling out from heaven, since it was already written on Mount Sinai in the Torah: "Determine the law according to the majority" [A quote from Exodus 23: 1-3, which means, according to the simple interpretation – just the opposite: "... Do not follow the majority to reach a punitive decision. When you give testimony in a lawsuit, do not pervert justice by siding with the majority..."]