Messenger of Allah ﷺ said, "Horses may be used for three purposes: For a man they may be a source of reward (in the Hereafter); for another, a means of protection; and for another, a source of sin. The man for whom they are a source of reward, is the one who keeps them for Allah's Cause and ties them with long ropes and lets them graze in a pasture or garden. Whatever those long ropes allow them to eat of that pasture or garden, will be written as good deeds for him and if they break their ropes and run one or two rounds, then all their footsteps and dung will be written as good deeds for him, and if they pass a river and drink from it though he has had no intention of watering them, even then, that will be written as good deeds for him. So such horses are a source of reward for that man. For the man who keeps horses for his livelihood in order not to ask others for help or beg his bread, and at the same time he does not forget Allah's right of what he earns through them and of their backs (that he presents it to be used in Allah's Cause), such horses are a shelter for him (from poverty). For the man who keeps them just out of pride and for showing off, they are a source of sin." Then Messenger of Allah ﷺ was asked about donkeys. He said, "Allah has not revealed anything to me regarding them except this comprehensive Verse: "Then anyone who has done good, equal to the weight of an atom (or a small ant) shall see it, and any one who has done evil, equal to the weight of an atom (or a small ant) shall see it." (99.7-8)
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ الْخَيْلُ لِثَلاَثَةٍ لِرَجُلٍ أَجْرٌ وَلِرَجُلٍ سِتْرٌ وَعَلَى رَجُلٍ وِزْرٌ فَأَمَّا الَّذِي لَهُ أَجْرٌ فَرَجُلٌ رَبَطَهَا فِي سَبِيلِ اللَّهِ فَأَطَالَ فِي مَرْجٍ أَوْ رَوْضَةٍ فَمَا أَصَابَتْ فِي طِيَلِهَا ذَلِكَ الْمَرْجِ وَالرَّوْضَةِ كَانَ لَهُ حَسَنَاتٍ وَلَوْ أَنَّهَا قَطَعَتْ طِيَلَهَا فَاسْتَنَّتْ شَرَفًا أَوْ شَرَفَيْنِ كَانَتْ آثَارُهَا وَأَرْوَاثُهَا حَسَنَاتٍ لَهُ وَلَوْ أَنَّهَا مَرَّتْ بِنَهَرٍ فَشَرِبَتْ مِنْهُ وَلَمْ يُرِدْ أَنْ يَسْقِيَ بِهِ كَانَ ذَلِكَ حَسَنَاتٍ لَهُ وَهِيَ لِذَلِكَ الرَّجُلِ أَجْرٌ وَرَجُلٌ رَبَطَهَا تَغَنِّيًا وَتَعَفُّفًا وَلَمْ يَنْسَ حَقَّ اللَّهِ فِي رِقَابِهَا وَلاَ ظُهُورِهَا فَهْىَ لَهُ سِتْرٌ وَرَجُلٌ رَبَطَهَا فَخْرًا وَرِيَاءً فَهِيَ عَلَى ذَلِكَ وِزْرٌ وَسُئِلَ رَسُولُ اللَّهِ ﷺ عَنِ الْحُمُرِ قَالَ مَا أَنْزَلَ اللَّهُ عَلَىَّ فِيهَا إِلاَّ هَذِهِ الآيَةَ الْفَاذَّةَ الْجَامِعَةَ {فَمَنْ يَعْمَلْ مِثْقَالَ ذَرَّةٍ خَيْرًا يَرَهُ * وَمَنْ يَعْمَلْ مِثْقَالَ ذَرَّةٍ شَرًّا يَرَهُ}