A moving charge creates a magnetic field due to relativistic effects, as explained by Edward Purcell. When a positively charged particle moves alongside a current-carrying wire, it perceives the electrons in the wire as being closer together, creating an effective negative charge from its perspective. This results in an attraction between the moving positive charge and the negative charge of the electrons, even though the wire is electrically neutral overall. According to Einstein's principles, forces observed in one reference frame must correspond to forces in another, linking electric and magnetic fields together. Understanding this relationship is crucial for grasping the concept of electromagnetism.