How does a tram operate without overhead wires?

To preserve the aesthetics of town centres, solutions have been created to enable trams to operate without catenaries :

How does a tram operate without overhead wires?