A theoretical analysis of bonding in transition metal-polyvalent metal compounds