William was a son of Albert I of Bavaria and Margaret of Brieg. William, allied with the Hooks, was in conflict with his father until 1394. In 1404 he succeeded him as count of Holland, Hainaut and Zeeland and duke of Bavaria-Straubing.