In very simple terms, a DC motor is coil of wire in close proximity to a permanent magnet. There is indeed some other stuff going on. For example there is a mechanical commutator that is actually switching different coils to the motor's (two) input terminals. Also there is more than one permanent magnet.
However at any particular instant in time, the system pretty much looks like a single coil (those windings which are connected at that moment in time ), and a single magnet(those magnets which are near those coils).
Motor action is usually explained in terms of the Lorentz Force Law: A current carrying wire, in a magnetic field, experiences a force, perpendicular to the direction of the current, and perpendicular to direction of the magnetic field. It is this force, which causes the rotor to move. In this way, the interaction between current in wires and magnetic fields of permanent magnets, causes physical force, which in turn produces motion.
F = I*L x BGenerator action is usually explained in terms of Faraday's Law of Induction: The voltage induced in a coil of wire is proportional to the time rate of change of magnetic flux through the coil, multiplied by the number of turns in the coil. This changing flux is caused by the relative motion of the rotor coils and the stator magnets. In this way, motion causes changing geometry, which causes changing magnetic flux through a coil, which causes a voltage to manifest across the coil.
V = N*(dΦ/dt)A practical result of Faraday's law, one that can be directly applied to building homemade generators, is that the voltage across a unloaded generator (or motor) tends to be proportional to its speed. The faster the generator turns, the greater (dΦ/dt), and the higher the voltage.