The Messenger of Allah ﷺ said, "Whoever leaves wealth, it belongs to his heirs, and whoever leaves dependents, they are our responsibility."
حدثنا حفص بن عمر حدثنا شعبة عن عدي بن ثابت عن أبي حازم
قال رسول الله ﷺ من ترك مالا فلورثته ومن ترك كلا فإلينا
Bukhari narrated it in the Book of Inheritance, Chapter on the Inheritance of the Captive, hadith no. 6763, and Muslim narrated it in the Book of Inheritance, Chapter on One Who Leaves Behind Wealth Which Then Goes to His Heirs, hadith no. 17/1619, from the hadith of Shubah, through this route.