It's always good to start with the fundamentals – so let's look at what a battery actually is. Whether it's an Alkaline or rechargeable, Nickel Metal Hydride or Lithium Polymer, a battery is a way of converting chemically stored energy into electricity.
The basic element of a battery is an electrochemical cell. Each "Half-Cell" is made of an electrode (a solid metal) and an electrolyte. The electrolyte can be any substance in which Ions, electrically charged atoms or molecules, can be separated by electrolysis (i.e. when an electrical potential is applied). Electrolytes can be liquid/gels (e.g. 'battery acid') or solids (i.e. salts – by which I don't just mean common table salt, Sodium Chloride). Both half-cells are connected by a Salt Bridge through which Ions released by the electrolyte are attracted to the other cell.
A schematic electrochemical cell
The chemicals used for the electrolytes and the metals used for the electrodes need to be chosen carefully to get the desired reactions. Sometimes an electrical current has to be applied to make anything happen – this is called electrolysis and is how metal plating is applied to anything from jewellery to aircraft parts. The object to be plated is used as an electrode and metal Ions bond to the surface of the electrode. But I digress!
When the chemicals used are in such a combination that they react readily without applying electricity, we have a Galvanic Cell where electrical energy is released by the chemical reactions occurring at one or both electrodes and a "potential difference" (i.e. voltage) exists between the two electrodes.
Cells can be very small, and by combining them together we get a battery of cells – hence the name 'battery'. For standard batteries, manufacturers have typically taken sheets of material for electrodes and (solid) electrolytes, and rolled them together – effectively reusing each layer – and is why the good old AA battery (et al) is cylindrical in shape.
Lithium Ion Technology
Research in Lithium batteries began in 1912, but it took until the 21st century to catch on and be economical to use in consumer technology devices. The primary reason for the difficulty in its use is the instability under certain conditions, therefore the sacrifice – from a cost point of view – is that Protection Circuits are required to regulate voltage and current levels to ensure that the cells are kept within safe limits.
Compared to the older Nickel-Cadmium and Nickel Metal Hydride rechargeable batteries, Lithium-Ion batteries are preferable as they have a greater specific energy density (energy stored per unit volume), have a much lower self-discharge rate, plus they lack the characteristics that required the older types of battery to go through complete charge cycles in order to avoid "memory effect" (where shallow discharges would prevent the cells from being unable to discharge properly in future).
Specific energy densities of battery chemistry types (Source)
In fact, regularly discharging Li-Ion batteries to 0% (something which you still see advised by tech sites which should know better) has been shown to be harmful, and partial discharges with regular top-ups is recommended to extend the recharge-cycle lifespan of Li-Ion batteries.
Recharge-cycle lifespan of Lithium Ion as a function of discharge depth (Source)
Lithium Ion batteries use a Lithium Metal Oxide compound on the cathode; i.e. the positive electrode during battery discharge. Many different Lithium-based compounds are used, but end-users are not made aware of this and "Lithium Ion" (or Li-Ion for short) is used as a catchall term. Each compound has its own advantages and disadvantages compared to its alternatives, and so is chosen as appropriate to its application.
According to Battery University, these are the types of Lithium Ion electrode in use today:
Various types of Lithium-Ion cathode compounds (Source)
In modern Li-Ion batteries, Graphite is used as the anode (the negative electrode during discharge). In the process of discharge, Lithium atoms are released from the cathode and release an electron, thus becoming ionised, and are received in the Graphite anode. The electrons released from the Lithium make up the current that powers the device connected to the battery.
How do the Lithium Ions get into the Anode though? Recall in our basic example above that each Half-Cell is connected via a Salt Bridge. In Li-Ion parlance, that has become known as the Separator, which is a porous material soaked with electrolyte. The Lithium Ions flow between electrodes via the separator.
Is Lithium Polymer different?
The chances are that if you read this site, you've heard of Lithium Polymer (Li-Polymer) as a distinct battery type from Li-Ion batteries. The difference between them lies in the material used as the separator. Rather than an inert substance with holes covered in electrolyte, the separator is made of a micro-porous polymer covered in an electrolytic gel that also serves as a catalyst that reduces the energy barrier in the chemical reaction between cathode and anode. Therefore, Li-Polymer batteries allow for a slight increase in energy density. However, this advantage is offset by a 10% to 30% cost increase. Therefore, because the same materials are used for cathode and anode, Li-Polymer batteries follow the same chemical process as Li-Ion batteries and so are not a distinct class.
Because the solid polymer is flexible, it is possible to construct flexible batteries and batteries that can be easily formed into various shapes and sizes, even thin films. So you'll most often see Li-Poly used for batteries which are relatively thin (e.g. Nokia's 'hero' BP-4L battery used in a dozen devices) or oddly shaped (e.g. to fit round other components in a tightly packed phone).
Just as with Li-Ion batteries though, Li-Polymer batteries are slowly degrading from the day they are created, and are subject to the same harm caused by deep-discharges.