Understanding the electrochemistry of silicon anodes in Li-ion batteries at the atomic scale