"And if you will not redeem it, then you shall break its neck" (Exodus 13:13). From here they said: the commandment of redemption takes precedence over the commandment of breaking the neck. The commandment of designating [a Hebrew maidservant as a wife] takes precedence over the commandment of redeeming her, as it says, "who has not designated her, then he shall let her be redeemed" (Exodus 21:8). The commandment of levirate marriage took precedence over the commandment of chalitzah in earlier times, when they intended it for the sake of the commandment; now that they do not intend it for the sake of the commandment, they said the commandment of chalitzah takes precedence over the commandment of levirate marriage. The commandment of redemption by the [original] owner takes precedence over redemption by any other person, as it says, "And if it is not redeemed, then it shall be sold at your valuation" (Leviticus 27:27). "And every firstling of a donkey you shall redeem with a lamb" (Exodus 13:13). Rabbi Chanina said: I asked Rabbi Eliezer in the great house of study, why are the firstlings of donkeys different from the firstlings of horses and camels? He said to me: it is a decree of Scripture; and furthermore, because they assisted Israel at the time they went out of Egypt, for there was not a single one of Israel who did not have ninety Libyan donkeys laden with the silver and gold of Egypt.
Redemption Comes First and the Donkeys That Carried Egypt's Gold
Yalkut Shimoni on Torah 224:1
וְאִם לֹא תִפְדֶּה וַעֲרַפְתּוֹ. מִכָּאן אָמְרוּ, מִצְוַת פְּדִיָּה קוֹדֶמֶת לְמִצְוַת עֲרִיפָה. מִצְוַת יְעִידָה קוֹדֶמֶת לְמִצְוַת פְּדִיָּה, שֶׁנֶּאֱמַר "אֲשֶׁר לֹא יְעָדָהּ וְהֶפְדָּהּ". מִצְוַת יִבּוּם קוֹדֶמֶת לְמִצְוַת חֲלִיצָה בָּרִאשׁוֹנָה שֶׁהָיוּ מִתְכַּוְּונִין לְשֵׁם מִצְוָה, עַכְשָׁיו שֶׁאֵין מִתְכַּוְּונִין לְשֵׁם מִצְוָה אָמְרוּ מִצְוַת חֲלִיצָה קוֹדֶמֶת לְמִצְוַת יִבּוּם. מִצְוַת גְּאֻלָּה בַּאֲדוֹן קוֹדֶמֶת לְכֹל אָדָם, שֶׁנֶּאֱמַר (ויקרא כז, כז) "וְאִם לֹא יִגָּאֵל וְנִמְכַּר בְּעֶרְכְּךָ". וּפֶטֶר חֲמֹר תִּפְדֶּה בְשֶׂה. אָמַר רַבִּי חֲנִינָא, שָׁאַלְתִּ(י) אֶת רַבִּי אֱלִיעֶזֶר בְּבֵית מוֹתְבָא רַבָּא, מַה נִּשְׁתַּנּוּ פִּטְרֵי חֲמוֹרִים מִפִּטְרֵי סוּסִים וּגְמַלִּים, אָמַר לוֹ, גְּזֵרַת הַכָּתוּב הִיא, וְעוֹד דְּסִיְּעוּ אֶת יִשְׂרָאֵל בְּשָׁעָה שֶׁיָּצְאוּ מִמִּצְרַיִם, שֶׁאֵין לְךָ כָּל אֶחָד וְאֶחָד שֶׁלֹּא הָיוּ לוֹ תִּשְׁעִים חֲמוֹרִים לוּבִים טְעוּנִים בְּכֶסֶף וְזָהָב שֶׁל מִצְרָיִם.