Linking chemical reactivity, magic numbers, and local electronic properties of clusters