In metals, we have positive ions surrounded by a cloud of delocalised elctrons which can move independantly of the metal ions. But why do these electrons leave the atoms which create the ions in the first place?
Hello, I don't think they are that independent of metals. If you give sufficient energy (decreasing with increasing period number; directly proportional with electronegativity), you can remove these electrons from the core.
As an alternative, electrochemical phenomena can also cause the formation of ions from elements; elemental potassium rapidly reduces mercury(II) ions, for example. The energy required is supplied by the redox system.
It should be noted that electrons don't just depart from a metal atom and leave it as an ion. When an electron leaves, another one from an adjacent atom moves in to maintain a neutral charge. That's how electrical conduction occurs; electrons migrate from atom to atom in response to an impressed electric field. As for why some elements (conductors) have electrons that can roam, while others (insulators) don't, you'll have to talk to someone more familiar with quantum mechanics than I.
Yes, quantum mechanics deals with this with "layer principle". In conductors, the gap between conducting and valence bands are very low, while there is a huge energy difference between those in insulators. Molecular orbital theory also explains this phenomenon.