On the origin of core-level binding energy shifts