Margaret of Avesnes, known as Margaret II of Hainaut and Margaret I of Holland, was born in 1311 to William I, Count of Hainaut, and Joan of Valois. She grew up in Hainaut and often visited France with her mother. In 1324, she married Louis of Bavaria in Cologne, becoming Queen of Germany; in 1328, she was crowned Holy Roman Empress alongside him in Rome.
After her brother William II died in battle in 1345, Margaret inherited Hainaut, Holland, Zeeland and Friesland. She traveled through her territories to establish her authority, granting economic privileges to towns and addressing the claims of her sisters. She initially governed directly, but returned to Germany at her husband’s request and left her son William to rule in her absence. Following Louis’s death in 1347, she surrendered sovereignty to William in return for an allowance, while the family’s lands were subsequently divided among her sons.
Margaret’s relationship with William deteriorated when he failed to provide the allowance promised in her abdication agreement. In 1350, she withdrew her resignation, prompting a civil conflict between the Hook faction supporting her and the Cod faction backing William. After military reversals and shifting support from Edward III of England, Margaret reached an agreement with her son in 1354: William was recognized as count of Holland and Zeeland, while she retained Hainaut for life.
Margaret ruled Hainaut until her death on June 23, 1356, at Le Quesnoy Castle, from infectious tuberculosis. She was buried at Minderbroeders Abbey in Valenciennes. Her surviving children included William, who inherited the Holland-Hainaut domains, and Albert, who later became count of Hainaut and Holland.