The torque in a DC electric motor is created by magnetic forces exerted on the electric current carried by the rotating part of the motor.  

In this virtual model, the flow of conventional current is represented by the moving red balls. The magnetic field is represented by the blue lines.

The current loop experiences a torque due to the off set forces on the top and bottom segments of the loop. 
The forces on the front and baCK segments of the loop exactly cancel, so that they do not contribute to the net torque on the loop.

The battery that drives this motor produces a constant voltage which can only drive the current in one direction.  However, the motor loop would get stuck lined up perpendicular to the magnetic field if its current never changed direction.  A clever mechanical connection called a commutator allows the single direction battery to supply a current to the loop that switches direction every half rotation.

