A dictionary describes, “a motor is a machine that converts electrical energy to mechanical energy.” In another words, the electrical energy is a “battery” and the mechanical energy is the “rotation.” To explain a motor physically, the well-known “Fleming’s left hand rule” is a good approach. When electric current flows through an electrical wire placed between two magnets facing with each other, it generates force. Electric current, magnetic field and motion respectively applies perpendicular directions each other just as when you open the middle finger (electric current), the forefinger (magnetic field) and the thumb (force) of your left hand respectively to mutually orthogonal axes.
Then, why does electric current which flow through the electrical wire generate force? This is because when the electric current flows through the electrical wire, it generates magnetic field around. The magnetic field attracts or repels magnetic field from magnets, which generate force to move the electric wire. The electrical energy here is “electric current,” and the mechanical energy is “force.”