That is more likely that they will give testimony according to its [true] objective, or [at least] they would fear that [other] oaths might be taken after their oaths. And fear Allāh and listen [i.e., obey Him]; and Allāh does not guide the defiantly disobedient people.
(O you who believe! When death approaches any of you, and you make a bequest, then take the testimony of two...) meaning that there should be two witnesses in such cases,
ذَوَا عَدْلٍ
(just men...) thus, describing them as just,
مِّنكُمْ
(of your own folk) Muslims.
أَوْ ءَاخَرَانِ مِنْ غَيْرِكُمْ
(or two others from outside) non-Muslims, meaning the People of the Book, according to Ibn `Abbas as Ibn Abi Hatim recorded. Allah said next,
Prior to this, there were injunctions relevant to religious considerations. Now some injunctions relevant to worldly considerations have been mentioned. The hint given is that the way Allah Ta` ala, in His mercy, helps His servants with better life in the Hereafter, He also takes care of better sustenance for them in the present world. (Bayan al-Qur'an)
The Background of Revelation
The event in the background of the revelation of the cited verses is that Budayl, a Muslim accompanied by Tamim and ` Adiyy, who were Christians at that time, travelled to Syria on a business visit. After reaching Syria, Budayl became sick. He made out a list of his things in writing and put it in his baggage. He did not inform his companions of the trip about it. When his sickness became serious, he called his Christian trip companions and made a will before them that they should deliver everything to his heirs. When they returned, they delivered everything to them. But, they took out a silver bowl which was polished with gold, or had gold inlay work on it, from the belongings. When the heirs found the list of things in the baggage left for them by the deceased, they asked the caretakers of the will if the deceased had sold something from the property, or was he very sick which may have compelled him to make unusual expenses. They answered their inquiry in the negative. Finally, the case came up for hearing before the Holy Prophet ﷺ . Since the heirs had no witnesses, the two Christians were put under oath. They declared that they had neither committed any breach of trust in what belonged to the deceased, nor had they hidden any of his things. In the end, based on the oath, the verdict was given in their favour. After the passage of some time, it was found that the two of them had sold that bowl to a goldsmith in Makkah. When asked, they said that they had bought it from the de-ceased. Since they had no witnesses at the time of purchase, they pleaded, they did not mention it earlier lest they be falsified.
In the Islamic law, such instructions are given concerning day-to-day life as provide lessons in a wider sphere of existence.. After a person’s death the division of his property is a family and economic matter. But this has been made a source of training in two important respects. One is that people should adopt the attitude of not giving consideration in their dealings to connections and relations: they should take into account only rights and truth. They should see what the truth is and not question who is favoured by it and who is not. The other is that every procedure should be treated as giving evidence before God. Anything which is in the custody of man is in God’s trust, because man saw it given by God with his own eyes, preserved it in his memory as given by God and now has to declare it with the help of the tongue given by God. Under these circumstances it will be a breach of trust if a man does not state the facts as he has seen them or committed them to memory.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.