Complex sentence: Margaret II, Countess of Flanders and Hainaut, had come into conflict with her son by her first marriage, John of Avesnes, because she wanted to disinherit him in favor of her children by her second husband, William II of Dampierre.
Split into simpler sentences: Margaret II, Countess of Flanders and Hainaut, had come into conflict with her son by her first marriage, John of Avesnes. She wanted to disinherit Avesnes in favor of her children by her second husband, William II of Dampierre.