Electromagnetism is the physics of the electromagnetic field: a field, encompassing all of space, which exerts a force on those particles that possess the property of electric charge, and is in turn affected by the presence and motion of such particles. The term electrodynamics is sometimes used to refer to the combination of electromagnetism with mechanics, and deals with the effects of the electromagnetic field on the dynamic behavior of electrically charged particles. Electromagnetism encompasses various real-world electromagnetic phenomena.
In physics, a magnetic field is the relativistic part of an electric field, as Einstein explained in 1905. When an electric charge is moving from the perspective of an observer, the electric field of this charge due to space contraction is no longer seen by the observer as spherically symmetric due to non-radial time dilation, and it must be computed using the Lorentz transformations. One of the products of these transformations is the part of the electric field which only acts on moving charges - and we call it the "magnetic field".
The quantum-mechanical motion of electrons in atoms produces the magnetic fields of permanent ferromagnets. Spinning charged particles also have magnetic moment. Some electrically neutral particles (like the neutron) with non-zero spin also have magnetic moment due to the charge distribution in their inner structure. Particles with zero spin never have magnetic moment.
Maxwell had perhaps one of the finest mathematical minds of any theoretical physicist of his time. Maxwell is widely regarded as the nineteenth century scientist who had the greatest influence on twentieth century physics, making contributions to the fundamental models of nature. In 1931, on the centennial anniversary of Maxwell's birthday, Einstein described Maxwell's work as the "most profound and the most fruitful that physics has experienced since the time of Newton."