The batteries used in electric bikes are made up of cells. As of early 2016, they have largely standardized to the 18650 cell. This cell is 18mm in diameter and 65mm long (the 0 is for round) and looks just like an AA flashlight battery, only larger.
There are many other shapes and sizes of cells, but these cells are produced in enormous quantity, and used in everything from laptops to Tesla cars. There is tough competition amongst the big players, so they are constantly improving.
The cells are arranged in parallel groups and series strings in order to produce the required Voltage and capacity.
When you slide a couple of batteries into a flashlight, you have to be careful to put them in the right way around, or it won’t work. What you are doing is putting cells in series. The first cell goes in with the + side down, and the next the same way, that means the + contact of the second battery is touching the - of the first. When you stack cells like this the Voltage adds up.
In the case of a common lithium cell, the Voltage is said to be “nominally” 3.6 to 3.7 V. When it is fully charged it will be 4.2 Volts, and when it is fully discharged is might be 2.75 to 2.9 Volts (Lithium Iron Phosphate cells have a slightly lower Voltage).
For an electric bike, we need at least 24 Volts and as much as 72 Volts (or more) to do the work of propelling the bike, so we need to stack a bunch of cells in series.
A 36 Volt lithium battery is made up of 10 cells, or groups of cells, in series. (10 cells X 3.6 V = 36 V)
Sometimes the Voltages don’t quite add up, for instance 13 cells in series (13S) should be described as a 46.8 Volt battery, but is almost always classed as 48 V. The 24, 36, and 48 Volt standard is a holdover from the days of lead acid batteries that often come in 12 Volt packages.
The common 18650 cells have a capacity of between 1.2 and 3.6 Amp hours at this time, so a single series string of 10 of these batteries might add up to 36 V, 2.5 Ah.