The recitation of ברכת המזון is a Mitzva from the Torah. It is learned from the words, ואכלת ושבעת וברכת, that we eat, are satiated, and we bless.
The ברכת המזון is also known as שלוש ברכות, the three blessings. Just as the Amida is known as שמונה עשרה and actually has nineteen blessings, Birkat Hamazon actually has four blessings. Three of the blessings are from the Torah and one is from the Rabbis.
Moshe Rabbeinu composed the first blessing, הזן, praising Hashem for giving sustenance. Yehoshua composed the second blessing of הארץ, praising Hashem for giving us ארץ ישראל. The third Bracha was composed by David and Shlomo regarding Yerushalayim. And the fourth Bracha was decreed by the Rabbis of Yavne, הטוב והמטיב, for the miracle at Beitar.
There was a great massacre of Jews at Beitar and after several years, the Jews were only able to bury their dead. Miraculously, the bodies did not decompose or smell. This happened on Tu B׳Av which became a happy day of matchmaking and joy.
Like זימון, the ברכת המזון should be recited carefully and with great Kavana.