Magnetism of intermetallic compounds