Chemical to electrical in the battery, then electrical to magnetic in the motor, which magnetic is really still electrical, magnetic to torque and RPM in the motor, which is then used to leverage friction and create inertia in the moving toy (kinetic energy) and if it goes up an incline, also potential energy.