Differences in bonding for Hf and Ta in metal-rich chalconides and pnictides