Electromagnetism is a physics theory that describes the interactions between charged particles at rest or in motion. This interaction is described using a mathematical artifact called
electromagnetic fieldThese interacions produce a vast number of amazing phenomena (light, heat, electric arches, sparks, radio waves, strong forces, time contraction/dilation, etc) really close to magic. Here we'll focus on the description of the two machines that are used to convert an electric current into mechanical energy (motion) and viceversa, widely known as electric motors, and electric generators. To understand their working principles we'd better start with the descripton of the magnetic field and its interaction with electric currents. A vector field describes how a physical magnitude is distribuited over a given area. This area can be as big as as country or as small as a coin. For example, below you can see the vector field representing the wind in the center of Spain. The length of the arrow indicates the size of the magnitude being described (i.e wind speed) and the inclination indicates its direction (i.e the wind direction: N, NE, E, SE, S, SW, W, NW). The magnetic field is represented in the same way (see the picture above, in the upper right corner), but here the intensity of the field is represented by the density of lines (per unit area), and the arrows represent the direction of a neddle (compass) placed at that point of the space. The most common and easy way to create a magnetic field on a certain area is just to place a magnet there. In the picture below you can see the field generated by a cilindrical magnet (Image from Geek3, CC).
Notice that the zones with an stronger magnetic field are the ones around the poles because there the lines are closer together.
Walter Fendt's DC motor applet
Walter Fendt's Lorent Force applet
Faraday's LAB (from University of Colorado web site)