The basic components of any cell include a positive electrode, a negative electrode and an electrolyte. In a lithium-ion battery, the negative electrode is made up of porous carbon (graphite) and the positive electrode is made up of a metal oxide (such as Lithium cobalt oxide). The most commonly used electrolyte is comprised of lithium salt, such as LiPF6 in an organic solution. Let us discuss the nature of metals before moving on to the working of the cell.

Lithium is a metal which has only one electron in its outermost shell and it wants to lose that electron to become stable. Pure lithium is actually so unstable that it reacts with water and air as well. On the other hand, lithium is quiet stable when it is part of the structure of a metal oxide. 

When we speak of graphite, it is important to note that graphite has a layered structure. The layers follow a horizontal, hexagonal pattern. One can imagine the structure of graphite as these layers being on top of each other and being loosely bonded to each other. One can picture the structure of graphite as that of a honeycomb. The specialty of graphite is that it can hold the lithium ions among its layers. 

To start with, let us talk about how a lithium-ion battery gets charged. The arrangement of the cell is such that we have Lithium cobalt oxide on one side, an electrolyte in between and graphite on the other side. To charge the cell, an external force is applied on this arrangement using a power source. The power source is connected using an external circuit. Positive side of the power source is connected to Lithium cobalt oxide and the negative side is connected to graphite. As the external circuit is now complete, the +ve side of the power source pulls the loosely held electrons on the Lithium atom towards itself and Lithium becomes Li+ ion. Now the electrons flow toward graphite from the external circuit and the Li+ ions move toward graphite through the electrolyte. Li+ ions as well the electrons get stored in the honeycomb structure of graphite. Graphite now contains Li+ ions as well as electrons stored in its honeycomb structure and the lithium-ion cell is said to be charged.

During discharge, a load is connected across the lithium-ion cell and the reverse of the above reaction takes place. The electrons move toward the metal oxide through the external circuit while Li+ moves towards the metal oxide through the electrolyte. In this manner, the battery continues to discharge till a point where no more Li+ ions can move out from the graphite structure.