Rationalizing th structures of Zintl and polar intermetallic phases