Battery packs are made up of individual cells connected together. Each cell has a more or less constant voltage dependent on its chemistry. For NiCad/NiMH, this is about 1.2V, for lead acid it is 2.0V, and for lithium cells it is on the order of 3.7V. Typical ebikes and scooters are designed to run on 24, 36, or 48 Volts, so a number of cells have to be series connected into a 'battery' that has the desired net voltage. A nominal 36V pack could be made from 10 lithium cells, 18 lead acid cells, or 30 NiMH cells.
As you draw current from a battery pack, the voltage will very slowly decrease until the cells start to go flat and then the voltage will plummet. The time that the battery lasts for is directly related to its capacity, measured in amp-hours (Ah). A pack that can deliver 1 amp for 1 hour has a capacity of 1 Ah. Most ebike batteries are on the order of 10 amp-hours. Suppose your bike uses 15 amps on average and has a 10Ah pack, then you would expect it to last for - quick, mental calculation... - 40 minutes.
In general, the size and cost of a cell will scale directly with its amp-hour capacity. To a first order, twice the amp-hours would mean twice the size, twice the weight, and twice the cost. In practice this deviates a little due to different packing densities and production scales, but it's usually pretty close. For instance, the familiar 'AA' NiMH has about 2 Ah, a 'C' cell has 4 Ah, a 'D' cell is about 8Ah, the large 'F' cells are 12-13 Ah, and double-D cells are 18-19Ah.
The figure that matters most when comparing how far a given battery pack will take you is not the amp-hour capacity but the total energy stored watt-hours. To make things more familiar, one watt-hour is one-thousandth of a kWh, the unit of energy used to measure household electrical usage. The watt-hours stored in a battery pack is approximated by taking the actual amp-hours and multiplying it by the pack voltage.
A higher voltage setup therefore needs fewer amp-hours to deliver the same range. So a 24V 8Ah battery can deliver 192 watt-hours, while a 48V 4Ah pack also has 192 watt-hours. Assuming that both batteries are of the same chemistry, then you could expect they would weigh the same, cost the same, and provide the same performance on appropriately designed ebikes (ie, one designed for 24V and the other for 48V).
192 watt-hours is about the smallest battery size you would want for an ebike. Many of the store-bought ebikes have about this much capacity since it keeps the battery cost down. For people who want to actually commute reasonable distances of 40-50km, then I would recommend on the order of 400 watt-hours. While it can vary a lot with usage habits, an energy consumption of 9-10 watt-hrs / km is typical on normal direct-drive setups.
When comparing between battery chemistries, one of the most relevant metrics is the Energy Density in watt-hrs / kg. This figure says how heavy a battery pack will have to be to achieve a certain range. For Lead Acid it is 20-30 whrs/kg, for NiCad it is 35-40 whrs/kg, NiMH is 50-60 whrs/kg, Li-ion is ~110 whrs/kg, and Li-Polymer is up to 160 whrs / kg. Knowing these values makes it easy to project the weight of a pack without having to look up data from the manufacturer.
One term you will frequently come across is the 'C' rate of a battery pack. This is a way of normalizing the performance characteristics so that batteries of different capacity are compared on equal terms. Suppose you have an 8 amp-hour pack. Then 1C would be is 8 amps, 2C would be 16 amps, 0.25C would be 2 amps etc. A higher 'C' rate of discharge is more demanding on the cells, and often requires specialty high rate batteries.
For example, suppose you see a 24V 4Ah NiMH battery pack on ebay, that is rated for 1C continuous and 2C max for short times. You might want to get two of these to make a 48V 4Ah battery for your ebike. You calculate that the range will be more than adequate for your short commute to work and back. The problem is that 1C is just 4 amps, while your ebike will probably draw 10-20 amps. If these cells are subject to such discharge rates, then the voltage will sag considerably, leading to slower performance, and the cycle life of the packs will be greatly reduced.
Most inexpensive NiMH packs are not really designed for discharges greater than 1C. That means that if your ebike draws 15 amps on average, you would want a pack that has a capacity on the order of 15 amp-hours more.