Halachaהלכה

Compensation for Unsolicited Benefit in Property

Jewish law addresses when an owner must compensate another for improvements or benefits received without consent. The sources examine the principle of unjust enrichment (זה נהנה וזה לא חסר) through cases of unauthorized planting, enhancement of property, and the broader obligation to avoid retaining unearned benefit.

זה נהנה וזה לא חסר

12 sources · verified

Opens as a working sheet — explore, annotate, and export.

Source 1 · Tanach
Verified

Devarim — Hashavas Aveidah

Deuteronomy 22:1-3

The Torah's commandment to return a lost object (השבת אבידה) reflects the broader principle that one may not passively retain a benefit that rightfully belongs to another. Commentators draw a conceptual link between this obligation and the requirement to pay for unsolicited benefit received from another's property.

לֹֽא־תִרְאֶה֩ אֶת־שׁ֨וֹר אָחִ֜יךָ א֤וֹ אֶת־שֵׂיוֹ֙ נִדָּחִ֔ים וְהִתְעַלַּמְתָּ֖ מֵהֶ֑ם הָשֵׁ֥ב תְּשִׁיבֵ֖ם לְאָחִֽיךָ׃ וְאִם־לֹ֨א קָר֥וֹב אָחִ֛יךָ אֵלֶ֖יךָ וְלֹ֣א יְדַעְתּ֑וֹ וַאֲסַפְתּוֹ֙ אֶל־תּ֣וֹךְ בֵּיתֶ֔ךָ וְהָיָ֣ה עִמְּךָ֗ עַ֣ד דְּרֹ֤שׁ אָחִ֙יךָ֙ אֹת֔וֹ וַהֲשֵׁבֹת֖וֹ לֽוֹ׃ וְכֵ֧ן תַּעֲשֶׂ֣ה לַחֲמֹר֗וֹ וְכֵ֣ן תַּעֲשֶׂה֮ לְשִׂמְלָתוֹ֒ וְכֵ֣ן תַּעֲשֶׂ֗ה לְכׇל־אֲבֵדַ֥ת אָחִ֛יךָ אֲשֶׁר־תֹּאבַ֥ד מִמֶּ֖נּוּ וּמְצָאתָ֑הּ לֹ֥א תוּכַ֖ל לְהִתְעַלֵּֽם׃ {ס}

If you see your fellow Israelite’s ox or sheep gone astray, do not ignore it; you must take it back to your peer. If your fellow Israelite does not live near you or you do not know who [the owner] is, you shall bring it home and it shall remain with you until your peer claims it; then you shall give it back. You shall do the same with their donkey; you shall do the same with their garment; and so too shall you do with anything that your fellow Israelite loses and you find: you must not remain indifferent.

Source 2 · Tanach
Verified

Vayikra — Lo Tigzol

Leviticus 19:13

The verse 'You shall not rob your neighbor' (לא תגזל) is understood by the Sages to encompass not only active theft but any retention of another's property or value without proper entitlement — grounding the rabbinic concept of unjust enrichment in the biblical prohibition against withholding what belongs to another.

לֹֽא־תַעֲשֹׁ֥ק אֶת־רֵֽעֲךָ֖ וְלֹ֣א תִגְזֹ֑ל לֹֽא־תָלִ֞ין פְּעֻלַּ֥ת שָׂכִ֛יר אִתְּךָ֖ עַד־בֹּֽקֶר׃

The wages of a laborer shall not remain with you until morning.

Source 3 · Chazal
Verified

Talmud Bavli, Bava Metzia

Bava Metzia 101a

The Gemara discusses the case of one who descends into another's field without permission and plants it (היורד לתוך שדה חבירו ונטעה). The Talmud distinguishes between scenarios — whether the field was fit or not fit for planting — and debates whether the planter is compensated for his labor and expenses, establishing the principle that an owner may be obligated to pay for benefit received even from an unsolicited act.

אִיתְּמַר: הַיּוֹרֵד לְתוֹךְ שְׂדֵה חֲבֵירוֹ וּנְטָעָהּ שֶׁלֹּא בִּרְשׁוּת, אָמַר רַב: שָׁמִין לוֹ, וְיָדוֹ עַל הַתַּחְתּוֹנָה. וּשְׁמוּאֵל אָמַר: אוֹמְדִין כַּמָּה אָדָם רוֹצֶה לִיתֵּן בְּשָׂדֶה זוֹ לְנוֹטְעָהּ. אָמַר רַב פָּפָּא וְלָא פְּלִיגִי: כָּאן – בְּשָׂדֶה הָעֲשׂוּיָה לִיטַּע, כָּאן – בְּשָׂדֶה שֶׁאֵינָהּ עֲשׂוּיָה לִיטַּע. וְהָא דְּרַב לָאו בְּפֵירוּשׁ אִיתְּמַר, אֶלָּא מִכְּלָלָא אִיתְּמַר. דְּהָהוּא דַּאֲתָא לְקַמֵּיהּ דְּרַב, אֲמַר לֵיהּ: זִיל שׁוּם לֵיהּ. אֲמַר לֵיהּ: לָא בָּעֵינָא. אֲמַר לֵיהּ: זִיל שׁוּם לֵיהּ, וְיָדוֹ עַל הַתַּחְתּוֹנָה. אֲמַר לֵיהּ: לָא בָּעֵינָא. לְסוֹף חַזְיֵיהּ דְּגַדְרַהּ וְקָא מְנַטַּר לַהּ. אֲמַר לֵיהּ גַּלִּית אַדַּעְתָּיךְ דְּנִיחָא לָךְ, זִיל שׁוּם לֵיהּ, וְיָדוֹ עַל הָעֶלְיוֹנָה.

§ An amoraic dispute was stated with regard to one who entered another’s field and planted trees in it without the permission of the owner of the field. Since the owner of the field profits from the planter’s actions, he is required to pay him. Rav says: The court appraises both the expenses for the one who planted the trees and the value of the improvements and the planter is at a disadvantage, i.e., the owner of the field pays the lesser of the two amounts. And Shmuel says: The court estimates how much a person would be willing to give for someone to plant trees in this field, and that is how much the owner of the field must pay. Rav Pappa said: And Rav and Shmuel do not disagree. Here, Shmuel’s ruling is with regard to a field that is designated for planting, while there, Rav’s ruling is with regard to a field that is not designated for planting. The Gemara notes: And this ruling of Rav was not stated explicitly; rather, it was stated implicitly. As there was a certain person who came before Rav after someone had planted trees in that person’s field. Rav said to him: Go and have the court appraise both the expenses for the one who planted the trees and the value of the improvements. The owner of the field said to him: I do not want these trees; why should I pay for them? Rav said to him: Go and have the court appraise both the expenses for the one who planted the trees and the value of the improvements, and he is at a disadvantage, i.e., you are obligated to pay him only the lesser of the two amounts. The owner of the field again said to him: I do not want these trees; why should I pay for them? Rav did not persist with his ruling, indicating that he conceded that the owner of the field was not obligated to pay. Eventually, Rav saw that the owner of the field had fenced in the field and was safeguarding the trees. Rav said to him: By doing so you have demonstrated your opinion that having those trees in your field is satisfactory to you. Therefore, I rule that you should go and have the court appraise both the expenses for the one who planted the trees and the value of the improvements, and he has the advantage, i.e., you are obligated to pay him the greater of the two amounts.

Source 4 · Chazal
Verified

Mishnah, Bava Metzia

Mishnah Bava Metzia 9:1

The Mishnah discusses rules governing one who takes possession of another's field for cultivation, laying the groundwork for distinguishing between authorized and unauthorized entry and the resulting obligations of payment or compensation for benefit derived.

הַמְקַבֵּל שָׂדֶה מֵחֲבֵרוֹ, מְקוֹם שֶׁנָּהֲגוּ לִקְצֹר, יִקְצֹר, לַעֲקֹר, יַעֲקֹר, לַחֲרשׁ אַחֲרָיו, יַחֲרשׁ. הַכֹּל כְּמִנְהַג הַמְּדִינָה.

this one must cut it as well. In a location where they were accustomed to uproot the produce, not to cut it with a sickle or a scythe, this one must uproot it as well.

Source 5 · Chazal
Verified

Talmud Bavli, Bava Metzia

Bava Metzia 35b

The Gemara examines additional dimensions of שומרים and compensation for benefit derived from another's property, raising the broader question of when passive receipt of benefit generates an obligation — a conceptual parallel to the uninvited planter case.

מַתְנִי׳ הַשּׂוֹכֵר פָּרָה מֵחֲבֵירוֹ וְהִשְׁאִילָהּ לְאַחֵר, וּמֵתָה כְּדַרְכָּהּ – יִשָּׁבַע הַשּׂוֹכֵר שֶׁמֵּתָה כְּדַרְכָּהּ, וְהַשּׁוֹאֵל יְשַׁלֵּם לַשּׂוֹכֵר. אָמַר רַבִּי יוֹסֵי: כֵּיצַד הַלָּה עוֹשֶׂה סְחוֹרָה בְּפָרָתוֹ שֶׁל חֲבֵירוֹ? אֶלָּא תַּחְזוֹר פָּרָה לַבְּעָלִים. גְּמָ׳ אֲמַר לֵיהּ רַב אִידִי בַּר אָבִין לְאַבָּיֵי: מִכְּדֵי, שׂוֹכֵר בְּמַאי קָנֵי לְהַאי פָּרָה? בִּשְׁבוּעָה. וְנֵימָא לֵיהּ מַשְׂכִּיר לְשׂוֹכֵר: דַּל אַנְתְּ וְדַל שְׁבוּעֲתָךְ, וַאֲנָא מִשְׁתַּעֵינָא דִּינָא בַּהֲדֵי שׁוֹאֵל. אֲמַר לֵיהּ: מִי סָבְרַתְּ, שׂוֹכֵר בִּשְׁבוּעָה הוּא דְּקָא קָנֵי לַהּ? מִשְּׁעַת מִיתָה הוּא דְּקָנֵי. וּשְׁבוּעָה כְּדֵי לְהָפִיס דַּעְתּוֹ שֶׁל בַּעַל הַבַּיִת.

MISHNA: In the case of one who rents a cow from another, and this renter then lends it to another person, and the cow dies in its typical manner, i.e., of natural causes, in the possession of the borrower, the renter takes an oath to the owner of the cow that the cow died in its typical manner, and the borrower pays the renter for the cow that he borrowed. A renter is exempt in a case of damage due to circumstances beyond his control, including death, but a borrower is liable to compensate the owner even for damage due to circumstances beyond his control. Rabbi Yosei said: How does the other party, i.e., the renter, do business with and profit from another’s cow? Rather, the value of the cow should be returned to the owner. The renter need not take an oath, but the borrower must compensate the owner of the cow. GEMARA: Rav Idi bar Avin said to Abaye: After all, with regard to the renter, with what does he acquire this cow to the extent that one who borrows the cow from him is liable to compensate him if it dies? He acquires it with an oath that he took to the owner of the cow that the cow died of natural causes. The Gemara asks: But since the acquisition is effected by the renter’s oath, let the one who rented his animal for hire say to the renter: Remove yourself and remove your oath. I do not want to deal with you at all in this case, and I will litigate with the borrower to recover my cow. Abaye said to Rav Idi bar Avin: Do you hold that it is with an oath that the renter acquires the cow? That is not so, as from the moment of the cow’s death, the renter acquires the cow. From the moment the cow dies in the possession of the borrower, the renter has the right to receive another cow in exchange. And this oath that the renter takes to the owner of the cow is not required by the halakha. Rather, he takes the oath to alleviate the concerns of the owner, so that the owner will not suspect him of negligence. Consequently, the owner of the cow cannot litigate with the borrower, and even if he waives his right to demand an oath from the renter, he is unable to receive a cow from the borrower.

Source 6 · Chazal
Verified

Talmud Bavli, Bava Kamma

Bava Kamma 20a

The Gemara here discusses the foundational question of זה נהנה וזה לא חסר — where one party benefits while the other suffers no loss — debating whether there is an obligation to pay for such benefit. This sugya is the primary locus for the concept of unjust enrichment in Talmudic law and directly informs the analysis of the uninvited planter case.

אֲמַר לֵיהּ רַב חִסְדָּא לְרָמֵי בַּר חָמָא: לָא הֲוֵית גַּבַּן בְּאוּרְתָּא בִּתְחוּמָא, דְּאִיבַּעְיָא לַן מִילֵּי מְעַלְּיָיתָא. אֲמַר: מַאי מִילֵּי מְעַלְּיָיתָא? אֲמַר לֵיהּ: הַדָּר בַּחֲצַר חֲבֵירוֹ שֶׁלֹּא מִדַּעְתּוֹ – צָרִיךְ לְהַעֲלוֹת לוֹ שָׂכָר, אוֹ אֵין צָרִיךְ? הֵיכִי דָמֵי? אִילֵּימָא בְּחָצֵר דְּלָא קָיְימָא לְאַגְרָא, וְגַבְרָא דְּלָא עֲבִיד לְמֵיגַר – זֶה לֹא נֶהֱנֶה וְזֶה לֹא חָסֵר! אֶלָּא בְּחָצֵר דְּקָיְימָא לְאַגְרָא, וְגַבְרָא דַּעֲבִיד לְמֵיגַר – זֶה נֶהֱנֶה וְזֶה חָסֵר! לָא צְרִיכָא – בְּחָצֵר דְּלָא קָיְימָא לְאַגְרָא, וְגַבְרָא דַּעֲבִיד לְמֵיגַר; מַאי? מָצֵי אֲמַר לֵיהּ: מַאי חַסַּרְתָּיךְ? אוֹ דִלְמָא, מָצֵי אָמַר:

§ In connection to the principle stated in the mishna, that if the animal derives benefit the owner of the animal pays for the benefit that it derived, the Gemara relates: Rav Ḥisda said to Rami bar Ḥama: You were not with us at night within our boundary when we raised dilemmas concerning exceptional matters. Rami bar Ḥama said to him: What are the exceptional matters you discussed? Rav Ḥisda said to him: With regard to one who resides in another’s courtyard without his knowledge or permission, must he pay him rent for living there or does he not need to pay him rent? The Gemara asks: What are the circumstances of this question? If we say that the case concerns a courtyard that does not stand to be rented out, i.e., if the squatter would not have lived there the owner would have kept it vacant, and the man squatting there is someone who would not have rented other living quarters because he has other lodgings available to him for free, then it is a case where this one, the squatter, does not derive benefit, and that one, the owner, does not suffer a loss; in that case certainly no payment is necessary. Rather, say that the discussion concerns a case of a courtyard that stands to be rented out, and the man squatting there would have rented other living quarters. If so, then this is a case where this one derives benefit and that one suffers a loss, and in that case he certainly must make payment. The dilemma was not with regard to either of these circumstances. The Gemara explains: No, it is necessary to raise the dilemma in the case of a courtyard that does not stand to be rented out, but the man squatting there would have rented other living quarters had he not squatted in this property. What is the halakha in this case? Is the squatter legally able to say to the owner of the courtyard: What loss have I caused you, as you would not have rented it out anyway? Or perhaps the owner of the courtyard is legally able to say to the squatter:

Source 7 · Chazal
Verified

Talmud Bavli, Bava Kamma

Bava Kamma 101a

The Gemara discusses cases where one adds value to another's object (שבח גזילה), debating the extent to which the original owner must pay for an enhancement added without his consent — a structural parallel to the uninvited planter case, highlighting when hana'ah creates a payment obligation.

תָּנוּ רַבָּנַן: הַנּוֹתֵן עֵצִים לֶחָרָשׁ לַעֲשׂוֹת מֵהֶן כִּסֵּא, וְעָשָׂה מֵהֶן סַפְסָל; סַפְסָל, וְעָשָׂה מֵהֶן כִּסֵּא – רַבִּי מֵאִיר אוֹמֵר: נוֹתֵן לוֹ דְּמֵי עֵצָיו. רַבִּי יְהוּדָה אוֹמֵר: אִם הַשֶּׁבַח יָתֵר עַל הַיְּצִיאָה – נוֹתֵן לוֹ אֶת הַיְּצִיאָה, וְאִם הַיְּצִיאָה יְתֵירָה עַל הַשֶּׁבַח – נוֹתֵן לוֹ אֶת הַשֶּׁבַח. וּמוֹדֶה רַבִּי מֵאִיר אִם נָתַן עֵצִים לֶחָרָשׁ לַעֲשׂוֹת מֵהֶן כִּסֵּא נָאֶה, וְעָשָׂה מֵהֶן כִּסֵּא כָּעוּר; סַפְסָל נָאֶה, וְעָשָׂה סַפְסָל כָּעוּר – אִם הַשֶּׁבַח יָתֵר עַל הַיְּצִיאָה, נוֹתֵן לוֹ דְּמֵי הַיְּצִיאָה; וְאִם הַיְּצִיאָה יְתֵירָה עַל הַשֶּׁבַח, נוֹתֵן לוֹ דְּמֵי הַשֶּׁבַח.

§ The Sages taught (Tosefta 10:8): With regard to one who gives wood to a carpenter to fashion a chair from it and he fashioned a bench from it instead, or one who gives him wood to fashion a bench and he fashioned a chair from it instead, Rabbi Meir says: The carpenter gives him the value of his wood and keeps the chair or bench, as he has acquired it due to the change. Rabbi Yehuda says: He does not acquire the item. Rather, if the value of the wood’s enhancement exceeds the carpenter’s expenses the owner gives the carpenter the expenses, and if the expenses exceed the enhancement of the wood he gives him the value of the enhancement. Since the carpenter deviated from the customer’s order, he is entitled to either his expenses or the enhancement, the smaller amount of the two. The baraita continues: And Rabbi Meir concedes that if he gave wood to a carpenter to fashion a beautiful chair from it and he fashioned an ugly chair from it, or to fashion a beautiful bench from it and he fashioned an ugly bench from it, then if the value of the wood’s enhancement exceeds the carpenter’s expenses the owner gives the carpenter the value of the expenses, and if the expenses exceed the enhancement he gives him the value of the enhancement. Since the carpenter did not deviate significantly from the customer’s instructions, Rabbi Meir concedes that the carpenter does not acquire the item due to the change.

Source 8 · Rishonim
Verified

Rambam, Mishneh Torah — Hilchot Gezelah va'Avedah

Mishneh Torah, Robbery and Lost Property 3:9-10

The Rambam codifies the law of one who unlawfully enters another's field and improves it, ruling that in a field designated for planting the owner pays only the cost of labor at the lowest rate, while in a field not designated for planting the planter takes nothing — reflecting the principle that unsolicited benefit does not automatically create an obligation to pay full value.

הַדָּר בַּחֲצַר חֲבֵרוֹ שֶׁלֹּא מִדַּעְתּוֹ. אִם אוֹתָהּ חָצֵר אֵינָהּ עֲשׂוּיָה לְשָׂכָר אֵינוֹ צָרִיךְ לְהַעֲלוֹת לוֹ שָׂכָר. אַף עַל פִּי שֶׁדֶּרֶךְ זֶה הַדָּר לִשְׂכֹּר מָקוֹם לְעַצְמוֹ. שֶׁזֶּה נֶהֱנֶה וְזֶה אֵינוֹ חָסֵר. וְאִם הֶחָצֵר עֲשׂוּיָה לְשָׂכָר אַף עַל פִּי שֶׁאֵין דֶּרֶךְ זֶה לִשְׂכֹּר צָרִיךְ לְהַעֲלוֹת לוֹ שָׂכָר שֶׁהֲרֵי חִסְּרוֹ מָמוֹן: מִי שֶׁהָיָה לוֹ צֶמֶר וְסַמָּנִים שְׁרוּיִין וּבָא אֶחָד וְצָבַע הַצֶּמֶר בַּסַּמָּנִין שֶׁלֹּא מִדַּעַת חֲבֵרוֹ. מְשַׁלֵּם לוֹ דְּמֵי מַה שֶּׁהִפְסִיד בַּצֶּמֶר וְאֵינוֹ מְחַשֵּׁב לוֹ שֶׁבַח סַמָּנִין שֶׁעַל גַּבֵּי הַצֶּמֶר. וְאִם תָּפַשׂ הַנִּזָּק דְּמֵי מַה שֶּׁחָסְרוּ מִן הַסַּמָּנִין אֵין מוֹצִיאִין מִיָּדוֹ:

The following rules apply when a person dwells in a courtyard belonging to a colleague without notifying him. If the courtyard is not usually rented out, he is not required to pay him rent. This applies even if the person who dwells within generally rents a dwelling, for one person is benefiting and the other is not suffering a loss. If the courtyard is generally rented out, the person who dwells within must pay rent even though he does not usually rent a dwelling, because he is causing the owner a loss of income. When a person owned wool that he was dyeing in a vat, and another person came and added other dyes without the consent of the owner, the latter must pay the owner of the wool for the decline in the value of the wool he caused. This payment does not include the value of the dye the owner used for the wool.If the person whose property was damaged seizes the value of dye that he lost, that money should not be expropriated from him.

Source 9 · Rishonim
External

Rashba, Responsa

Teshuvot haRashba part I 870

The Rashba addresses a case of one who improves another's property without authorization, analyzing the competing principles of unjust enrichment (זה נהנה) and the owner's right not to be compelled to purchase an unsolicited benefit, and establishing important parameters for when the beneficiary must compensate the actor.

Source 10 · Acharonim
Verified

Shulchan Arukh, Choshen Mishpat

Shulchan Arukh, Choshen Mishpat 375:1-3

The Shulchan Arukh codifies the laws of one who descends into another's field and plants it without permission, distinguishing between a field that was going to be planted anyway (ראויה לנטיעה) and one that was not, and ruling on the extent of the owner's obligation to compensate for the improvement.

היורד לתוך שדה חבירו שלא ברשות ונטעה אם היתה שדה העשויה ליטע אומדין כמה אדם רוצה ליתן בשדה זו לנוטעה ונוטל מבעל השדה ואם אינה עשויה ליטע שמין לו וידו על התחתונה: הגה סתם כרם עשוי ליטע (ריב"ש סי' תתקט"ו) העושה טובה לחבירו שלא ברשות ע' לעיל סי' רס"ד וכן הלומד עם בן חבירו בלא דעת האב ע"ל סי' של"ה ס"א:

Source 11 · Acharonim
Verified

Tomer Devorah — Chapter 1

Tomer Devorah 1:1

Rav Moshe Cordovero opens by describing God's attribute of forbearance (erech apayim), noting that the divine sustains and benefits even those who do not acknowledge the source of their benefit. This is applied homiletically to human relations: just as God does not withhold benefit even when it is unreciprocated, so too in interpersonal dealings the receipt of benefit creates a moral — and sometimes legal — obligation of acknowledgment and return.

הָאָדָם רָאוּי שֶׁיִּתְדַּמֶּה לְקוֹנוֹ וְאָז יִהְיֶה בְּסוֹד הַצּוּרָה הָעֶלְיוֹנָה צֶלֶם וּדְמוּת, שֶׁאִלּוּ יְדֻמֶּה בְּגוּפוֹ וְלֹא בִּפְעֻלּוֹת הֲרֵי הוּא מַכְזִיב הַצּוּרָה וְיֹאמְרוּ עָלָיו צוּרָה נָאָה וּמַעֲשִׂים כְּעוּרִים. שֶׁהֲרֵי עִיקָר הַצֶּלֶם וְהַדְּמוּת הָעֶלְיוֹן הֵן פְּעֻלּוֹתָיו, וּמַה יוֹעִיל לוֹ הֱיוֹתוֹ כְּצוּרָה הָעֶלְיוֹנָה דְּמוּת תַּבְנִית אֵבָרָיו וּבַפְּעֻלּוֹת לֹא יִתְדַמֶּה לְקוֹנוֹ. לְפִיכָךְ רָאוּי שֶׁיִּתְדַּמֶּה אֶל פְּעֻלּוֹת הַכֶּתֶר שֶׁהֵן י"ג מִדּוֹת שֶׁל רַחֲמִים עֶלְיוֹנוֹת. וּרְמוּזוֹת בְּסוֹד הַפְּסוּקִים (מיכה ז, יח) מִי אֵל כָּמוֹךָ.

Chapter 1 - That it is fitting for a person to resemble his Creator: It is fitting for a person to resemble his Creator and then he will be [configured] in the secret of the Highest Form, [both] in image and likeness. As if he is alike in his body but not in his actions, he betrays the Form; and they will say about him, "A lovely form, but ugly deeds." As behold, the essence of the Highest Image and Likeness is His actions. And what will it benefit him to have the structure of his limbs like the Highest Form, but not resemble his Creator in his actions?

Source 12 · Acharonim
Verified

Maharal, Netivot Olam — Netiv HaDin

Netivot Olam, Netiv Hadin 1:1

The Maharal reflects on the foundations of Jewish monetary law, emphasizing that the Torah's conception of justice (din) is rooted in restoring a natural moral equilibrium. This provides a philosophical underpinning for why one who derives benefit from another's resources — even without the latter's loss — may still bear a moral and legal obligation.

בספר משלי (י') שמחה לצדיק עשות משפט ומחתה לפועלי און. שלמה המלך רצה לומר כאשר העולם נוהג במשפט שיש דין בין איש לחבירו דבר זה הוא שמחה אל הצדיק אשר חפץ ואוהב היושר, לכך המשפט שמחה אליו כי המשפט הוא היושר בעצמו, ומחתה לפועלי און, ר"ל אשר אינם רוצים במעשה היושר הוא מחתה עליהם:

Source 13 · Acharonim
Verified

Shulchan Arukh, Choshen Mishpat

Shulchan Arukh, Choshen Mishpat 264:4

The Shulchan Arukh rules on the case of one who acts as an agent for another's benefit without being asked (יורד שלא ברשות), addressing when the benefitting party must pay for the labor and costs incurred on their behalf — forming the broader halachic framework for unsolicited benefit.

ירד להציל ולא הציל אין לו אלא שכרו הראוי לו: הגה ודוקא שהתנה עם הבעלים אבל לא התנה עם הבעלים וירד להציל ולא הציל אפילו שכרו אין לו דהא לא הועיל לו וכן אם עלה חמורו מאליו אבל אם הציל לא יוכל בעל החמור לומר חמורי היה עולה בלעדי הצלתך אלא חייב ליתן לו שכרו וכן שנים שנתפסו והוציא אחד הוצאות אם השני יצא מן המאסר בלא השתדלות חבירו אין חייב ליתן לחבירו כלום הואיל ולא התנה עמו ואם לא יצא רק ע"י השתדלות האחר לא יוכל לומר לא הייתי צריך להשתדלותך כי ידי תקיפה אע"פ שהאמת אתו מ"מ חייב ליתן לו כפי מה שנהנה לפי ראות ב"ד כן נ"ל (ועיין במרדכי פ' הגוזל בתרא תשובת מהר"ם ודלא כמהר"ם פאדוואה סי' ס"ג) ואם נראה לב"ד שלא הוצרך להרבות בהוצאות בשבילו דאפי' בשבילו לבדו היה צריך לכל הוצאות אלו אינו חייב ליתן לו כלום דזה נהנה וזה אינו חסר לכן יש מי שפסק מי שהציל ספריו וספרי חבירו אם לא הוצרך להרבות הונאות בשביל חבירו אין חבירו חייב לשלם לו כלום (הגהות אלפסי פ' הגוזל) ונ"ל דווקא שירד תחלה להציל שלו אלא שהציל ג"כ של חבירו עמו אבל אם ירד על דעת שניהן חייב ליתן לו מה שנהנה מאחר שהציל של חבירו וכמו שנתבאר כן נ"ל וכן כל אדם שעושה עם חבירו פעולה או טובה לא יוכל לומר בחנם עשית עמדי הואיל ולא צויתיך אלא צריך ליתן לו שכרו (ר"ן פ' שני דייני גזירות):