Michal had been given to David as his wife by his father king Saul after he had said he wanted the bride price to be hundred foreskins of the philistines.
1 Samuel 16:27 NIV
27 David took his men with him and went out and killed two hundred Philistines and brought back their foreskins. They counted out the full number to the king so that David might become the king’s son-in-law. Then Saul gave him his daughter Michal in marriage.
But later Michal is said to have married Paltiel which would have been contravening the law
2 Samuel 3:14 NIV
14 Then David sent messengers to Ish-Bosheth son of Saul, demanding, “Give me my wife Michal, whom I betrothed to myself for the price of a hundred Philistine foreskins.”15 So Ish-Bosheth gave orders and had her taken away from her husband Paltiel son of Laish.
No divorce is mentioned between David and Michal but she returns to David after having been a wife to another man.
According to the law both the adultery and the adulteress were stoned to death
Leviticus 20:10 NIV
10 “‘If a man commits adultery with another man’s wife—with the wife of his neighbor—both the adulterer and the adulteress are to be put to death.
Why was Michal not stoned for committing adultery?