The role of the electronic structure in charge exchange between low energy ions and surfaces