Narrated Abu Huraira: Allah's Messenger ﷺ said, "There is no Diya for persons killed by animals or for the one who has been killed accidentally by falling into a well or for the one killed in a mine. And one-fifth of Rikaz (treasures buried before the Islamic era) is to be given to the state".
The Prophet Muhammad was teaching his followers about justice and fairness when he said this hadith. He wanted them to understand that they should not expect anything from Allah if they were negligent in their actions but instead accept the consequences of their mistakes without expecting anything in return. He also wanted them to understand the importance of sharing what they have with others so everyone can benefit from it equally.