Physical and chemical origin of size-dependent spontaneous interfacial alloying of core–shell nanostructures