The starter is a motor with a switch that connects it to the battery and to the chassis ground. The stored power of the battery is what spins the starter.
The starter is an electrical motor. It turns the electricity it receives into a rotation force used to spin the flywheel by way of a series of brushes and coils.