All praise is due to Allah, and may peace and blessings be upon the Messenger of Allah.
The Qur’an establishes that the Angel of Death is entrusted with taking the souls of human beings. Allah Almighty says:
“Say, ‘The Angel of Death who has been entrusted with you will take your souls. Then to your Lord you will be returned.’” [As-Sajdah: 11]
As for the souls of animals and birds, neither the Qur’an nor the authentic Sunnah contains a text establishing who takes them.
There is a hadith stating that the lifespans of animals are connected to their glorification of Allah and that Allah takes their souls after their glorification comes to an end. However, Al-Albani judged this hadith to be fabricated, so it cannot be used as evidence.
Scholars have differed on this matter. Some have said that the Angel of Death also takes the souls of animals, while others have said that Allah Almighty takes their souls Himself. There is no authentic evidence that conclusively settles this question.
Therefore, it is preferable not to delve too deeply into this unseen matter, because we should not make definitive claims about matters for which there is no authentic evidence. The Prophet Muhammad (peace and blessings be upon him) said:
“Those who go to extremes are doomed.” Narrated by Muslim.
It is authentically reported from Abu Hurayrah (may Allah be pleased with him), in his explanation of the following verse, that animals and birds will be gathered on the Day of Judgment:
“There is no creature on earth nor bird that flies with its wings except that they are communities like you... Then to their Lord they will be gathered.” [Al-An'am: 38]
The animals and birds will be resurrected and gathered on the Day of Judgment so that Allah will establish justice among them. Even the hornless sheep will receive justice against the horned sheep. Then they will be told, “Become dust.”
At that point, the disbeliever will wish that he had been dust, as Allah Almighty says:
“And the disbeliever will say, ‘Oh, I wish I were dust!’” [An-Naba': 40]
Therefore, what is established is that animals will be gathered on the Day of Judgment and justice will be established among them, after which they will become dust. As for the details of what happens to their souls from the time of death until the Day of Judgment, no authentic text has clarified this.
And Allah knows best.