Mass is not fundamentally an electromagnetic phenomenon. Mass is a fundamental property of matter and is a result of interactions between particles at the subatomic level, primarily through the Higgs field in the framework of the Standard Model of particle physics.
In the Standard Model, particles acquire mass through the Higgs mechanism. According to this mechanism, elementary particles interact with the Higgs field, which permeates throughout space. The interaction between particles and the Higgs field imparts mass to the particles. This mechanism explains why certain particles have mass while others, such as photons, do not.
Electromagnetism, on the other hand, is one of the four fundamental forces in nature, along with gravity, the strong nuclear force, and the weak nuclear force. Electromagnetism is responsible for the interactions between electrically charged particles and the electromagnetic fields they create.
While electromagnetic interactions are important in various physical phenomena and play a role in the behavior of charged particles, mass is a distinct property that arises from different underlying mechanisms and is not solely dependent on electromagnetic interactions.