وَإِذَا حَضَرَ ٱلْقِسْمَةَ أُو۟لُوا۟ ٱلْقُرْبَىٰ وَٱلْيَتَـٰمَىٰ وَٱلْمَسَـٰكِينُ فَٱرْزُقُوهُم مِّنْهُ وَقُولُوا۟ لَهُمْ قَوْلًا مَّعْرُوفًا Qur’an An-Nisaa' (4:8)Waitha hadara alqismata oloo alqurba waalyatama waalmasakeenu faorzuqoohum minhu waqooloo lahum qawlan maAAroofan
I.e., people who do not have any legal claim to the inheritance, but nevertheless deserve to be considered.
For example, in the case of orphaned children whose grandfather then dies, leaving behind other children, some scholars rule that an obligatory bequest should be made to them despite not having a share in inheritance.