And whoever disobeys Allāh and His Messenger and transgresses His limits - He will put him into the Fire to abide eternally therein, and he will have a humiliating punishment.
Warning Against Transgressing the Limits for Inheritance
Meaning, the Fara'id are Allah's set limits. This includes what Allah has alloted for the heirs, according to the degree of relation they have to the deceased, and their degree of dependency on him. Therefore, do not transgress or violate them. So Allah said;
وَمَن يُطِعِ اللَّهَ وَرَسُولَهُ
(And whosoever obeys Allah and His Messenger,) regarding the inheritance, and does not add or decrease any of these fixed shares by use of tricks and plots. Rather, he gives each his appointed share as Allah commanded, ordained and decided,
It is the consistent style of the Holy Qur'an that whenever it has described the beliefs and injunctions prescribed by Allah, it is followed by promises of reward or warnings of punishment.
This is what has been done here in these two verses after mentioning the rules of inheritance. The purpose is to stress upon Muslims to obey these injunctions.
SOME ADDITIONAL RULES OF INHERITANCE
A Muslim cannot inherit from a Kafir
Although, the distribution of inheritance is based on nearness of kinship, but there are certain exceptions to this rule. First of all, the deceased and his inheritor should not be from two different religions. Therefore, a Muslim will not inherit from any kafir and no kafir from a Muslim, no matter what lineal relationship they may have between them. The Holy Prophet ﷺ said: لا یرِثُ المسلِم الکافرِ ولا الکاففرُ المَسلم (مشکوٰۃ ص 263)
Payment of the dues of orphans, abiding by wills, release of the inheritance to the inheritors, etc., are among those matters on which a man’s being sent to hell or heaven depends. To make out a will disposing of one-third part of one’s property is permissible by Islamic law. But anyone making out a will with the intention of depriving a person of his rightful inheritance, would be committing a sin that could condemn him to Hell. Man has to follow the law of God in this regard and not his own personal desires or family expediencies.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.