It is written, "And the LORD your God will keep for you the covenant and the kindness" (Deuteronomy 7:12). Rabbi Shimon ben Halafta said: To what is the matter comparable? To a king who married a noblewoman [matrona], and she brought him two tenant-farmers [as her dowry]; the king in turn set up against them two tenant-farmers of his own. The noblewoman lost what was hers; the king too took back what was his. After some days the noblewoman arose and adorned herself and brought the two tenant-farmers; the king too brings his own. The king said: Let these and those be made into a crown and set upon the head of the noblewoman. So you find: Abraham gave his children two tenant-farmers, charity and justice, as it is said, "For I have known him, that he may command" and so on (Genesis 18:19). The Holy One, blessed be He, in turn set up against them two tenant-farmers, kindness and mercy, as it is said, "And the LORD your God will keep for you the covenant and the kindness" (Deuteronomy 7:12), and it says, "and He will give you mercy" and so on (Deuteronomy 13:18). Israel lost what was theirs, as it is said, "who turn justice to wormwood and cast charity to the ground" (Amos 5:7); the Holy One, blessed be He, in turn took back what was His, as it is said, "for I have taken away My peace from this people... the kindness and the mercy" (Jeremiah 16:5). They arose and made themselves worthy and brought back those two tenant-farmers, as it is said, "Zion shall be redeemed with justice, and her returnees with charity" (Isaiah 1:27); the Holy One, blessed be He, in turn brings His own, as it is said, "for the mountains may depart and the hills be removed, but My kindness shall not depart from you" and so on (Isaiah 54:10). He said: Let these and those be made into a crown and set upon their head, as it is said, "And I will betroth you to Me in righteousness and in justice and in kindness and in mercy" (Hosea 2:21).
The King and the Matrona and the Crown of Justice and Mercy
Yalkut Shimoni on Torah 83:1
כְּתִיב (דברים ז, יב) "וְשָׁמַר ה' אֱלֹהֶיךָ לְךָ אֶת הַבְּרִית וְאֶת הַחֶסֶד". אָמַר רַבִּי שִׁמְעוֹן בֶּן חֲלַפְתָּא, לְמָה הַדָּבָר דּוֹמֶה, לְמֶלֶךְ שֶׁנָּשָׂא מַטְרוֹנָא וְהִכְנִיסָה לוֹ שְׁנֵי אָרִיסִין אַף הַמֶּלֶךְ זָקַף לָהּ כְּנֶגְדָּן שְׁנֵי אָרִיסִין. אִבְּדָה מַטְרוֹנָא אֶת שֶׁלָּהּ, אַף הַמֶּלֶךְ נָטַל אֶת שֶׁלּוֹ. לְאַחַר יָמִים עָמְדָה מַטְרוֹנָא וְקִשְׁטָה עַצְמָה וְהֵבִיאָה שְׁנֵי אָרִיסִין, אַף הַמֶּלֶךְ מֵבִיא אֶת שֶׁלּוֹ. אָמַר הַמֶּלֶךְ, אֵלוּ וָאֵלוּ יֵעָשׂוּ עֲטָרָה וְיִנָּתְנוּ בְּרֹאשָׁהּ שֶׁל מַטְרוֹנָא. כָּךְ אַתְּ מוֹצֵא אַבְרָהָם נָתַן לְבָנָיו שְׁנֵי אָרִיסִין, צְדָקָה וּמִשְׁפָּט, שֶׁנֶּאֱמַר, כִּי יְדַעְתִּיו לְמַעַן אֲשֶׁר יְצַוֶּה וְגוֹ' אַף הַקָּדוֹשׁ בָּרוּךְ הוּא זָקַף לָהֶם כְּנֶגְדָּן שְׁנֵי אָרִיסִין חֶסֶד וְרַחֲמִים, שֶׁנֶּאֱמַר, "וְשָׁמַר ה' אֱלֹהֶיךָ לְךָ [אֶת הַבְּרִית וְאֶת הַחֶסֶד" וְאוֹמֵר (שם יג, יח) "וְנָתַן לְךָ רַחֲמִים" וְגוֹ'], אִבְּדוּ יִשְׂרָאֵל אֶת שֶׁלָּהֶן, שֶׁנֶּאֱמַר, (עמוס ה, ז) "הַהֹפְכִים לְלַעֲנָה מִשְׁפָּט וּצְדָקָה לָאָרֶץ [הִנִּיחוּ"] אַף הַקָּדוֹשׁ בָּרוּךְ הוּא נָטַל אֶת שֶׁלּוֹ, שֶׁנֶּאֱמַר, (ירמיה טז, ה) "כִּי (אִם) אָסַפְתִּי אֶת שְׁלוֹמִי מֵאֵת הָעָם הַזֶּה... אֶת הַחֶסֶד וְאֶת הָרַחֲמִים", עָמְדוּ וְכִשְּׁרוּ עַצְמָן, וְהֵבִיאוּ אוֹתָן שְׁנֵי אָרִיסִין, שֶׁנֶּאֱמַר, "צִיּוֹן בְּמִשְׁפָּט תִּפָּדֶה וְשָׁבֶיהָ בִּצְדָקָה", אַף הַקָּדוֹשׁ בָּרוּךְ הוּא מֵבִיא אֶת שֶׁלּוֹ, שֶׁנֶּאֱמַר, (שם נד, י) "כִּי הֶהָרִים יָמוּשׁוּ וְהַגְּבָעוֹת תְּמּוּטֶינָה וְחַסְדִּי מֵאִתֵּךְ לֹא יָמוּשׁ" וְגוֹ'. אָמַר, אֵלוּ וְאֵלוּ יַעֲשׂוּ עֲטָרָה וְיִנָּתְנוּ (בְּרֹאשׁוֹ) [בְּרֹאשָׁם], שֶׁנֶּאֱמַר, "וְאֵרַשְׂתִּיךְ לִי בְּצֶדֶק וּבְמִשְׁפָּט וּבְחֶסֶד וּבְרַחֲמִים".