The Messenger of Allah ﷺ said, "Goodness is tied to the forelocks of horses until the Day of Resurrection. Horses are of three kinds. For one man they are a reward, for another a covering, and for another a burden.As for the one for whom they are a reward, he is the man who keeps them for the sake of Allah and prepares them for that purpose. Nothing enters their bellies but Allah writes for him a reward."The hadith contains a longer story.
حدثنا قتيبة حدثنا عبد العزيز بن محمد عن سهيل بن أبي صالح عن أبيه
قال رسول الله ﷺ الخيل معقود في نواصيها الخير إلى يوم القيامة الخيل لثلاثة هي لرجل أجر وهي لرجل ستر وهي على رجل وزر فأما الذي له أجر فالذي يتخذها في سبيل الله فيعدها له هي له أجر لا يغيب في بطونها شيء إلا كتب الله له أجرا وفي الحديث قصة
[Its isnad is sahih]. Nasai also reported it (6:215, no. 3592) (chapter on Horses, section, "Horses have goodness tied to their forelocks until the Day of Resurrection"), from the hadith of Suhayl, in full, and the hadith has many corroborating narrations.The hadith of Malik in Muwatta (2:446–447) is reported in full, and from his route it was reported by Bukhari (no. 2860) and Muslim (no. 987), among others.