עד דרש אחיך. וְכִי תַעֲלֶה עַל דַּעְתְּךָ שֶׁיִּתְּנֵהוּ לוֹ קֹדֶם שֶׁיִּדְרְשֵׁהוּ? אֶלָּא דָּרְשֵׁהוּ שֶׁלֹּא יְהֵא רַמַּאי (בבא מציעא כ"ז; עי' ספרי): עד דרש אחיך [AND IT SHALL BE WITH THEE] UNTIL THY BROTHER ENQUIRES [FOR IT] — But would it ever enter your mind that one could give it back before he enquires for it (Scripture distinctly states that you do not know to whom the animal belongs)?! But the meaning of the verse is: Thou shalt make diligent enquiries of him that he should not be a fraudulent claimant (Bava Metzia 27b. 28a; cf. Sifrei Devarim 223:4).
והשבתו לו. שֶׁתְּהֵא בוֹ הֲשָׁבָה, שֶׁלֹּא יֹאכַל בְּבֵיתְךָ כְּדֵי דָּמָיו וְתִתְבָּעֵם מִמֶּנּוּ. מִכָּאן אָמְרוּ, כָּל דָּבָר שֶׁעוֹשֶׂה וְאוֹכֵל יַעֲשֶׂה וְיֹאכַל וְשֶׁאֵינוֹ עוֹשֶׂה וְאוֹכֵל יִמָּכֵר (בבא מציעא כ"ח): והשבתו לו AND THOU SHALT RESTORE IT TO HIM — it is necessary that there be some restoration — that it (the animal) should not eat in your house to its own value, and you claim this from him (in which case there is no actual restoration of what has been lost). From here, they (the Rabbis) derived the law: Whatever works and requires food (as, for instance, oxen, etc., the cost of whose food is set off by the value of its labour) should work and eat; whatever does not work but requires feeding (as, for instance, sheep) should be sold and the money restored to the man who lost it (Bava Metzia 28b).