Points derived from the two hadiths:
1 – Maʿiz ibn Mālik al-Aslamī (may Allah be pleased with him) came to the Prophet ﷺ while he was in the mosque, called out to him, and confessed that he had committed adultery. The Prophet ﷺ turned away, hoping he might retract and repent privately to his Lord. But Maʿiz, angered with himself and determined to purify his soul through the prescribed penalty, confronted the Prophet again and confessed a second time. The Prophet ﷺ continued to turn away until Maʿiz had testified against himself four times. Only then did the Prophet verify his condition: he asked whether Maʿiz was insane, and Maʿiz said no; he asked Maʿiz’s relatives about his mental soundness, and they praised him. He then asked whether Maʿiz was previously married or a virgin—because only a previously married adulterer is to be stoned—and Maʿiz confirmed he was married. The Prophet ﷺ inquired further, lest what Maʿiz had done fall short of the act that incurs the ḥadd, perhaps mere touching or kissing; Maʿiz declared he had committed the very act of adultery. When the Prophet ﷺ had confirmed every detail and was certain the penalty must be carried out, he ordered his Companions to take Maʿiz and stone him. They led him to Baqīʿ al-Gharqad, the place where funeral prayers are offered, and began the stoning. When Maʿiz felt the sting of the stones, his human nature sought escape and he fled; they caught up with him at al-Ḥarra and continued until he died—may Allah be pleased with him.
2 – Adultery is established by confession just as it is established by testimony. A discussion will follow on whether a single confession suffices or whether, as in this hadith, four confessions are required.
3 – The confession of a madman is not accepted and no ḥadd is applied to him, because legal responsibility (taklīf) is a precondition for the prescribed penalties. In some narrations of this hadith the Prophet ﷺ asked, “Are you insane?” and he replied, “No.”
4 – A judge or muftī must investigate thoroughly when issuing rulings and ask detailed questions about matters that could change the verdict. The Prophet ﷺ questioned the confessor here about his deed until it became clear that he had committed the very act of adultery, and he turned away from him hoping he would retract his admission—until the confession was repeated four times.