A motor is a device to exchange from electrical power to mechanical power and exchanged mechanical power (rotary motion) is generated by permanent magnet and electrical wire.
To understand the technical theory of a motor, we need to know a power act on magnet field and current.
Magnet flux (B) that is made by permanent magnet goes toward from N pole to S pole.
When we put an electric wire right angle and current (I) is applied, we can get mechanical force (F).
This force is shown below formula and called "BLI law".
B: Magnetic flux
L: Wire length in the magnetic field
The direction of this force is shown "Law of left hand of Fleming", thumb shows F (Force way), and first finger shows B (way of magnet flux), second finger shows I (current way).
A motor is a device to generate continuous torque with multi coils, commutator and brush that are used to change current direction up to these technical theories.