In our macro world we identify many forms of energy and one of those forms, or two of those forms if you like, is/are electricity and magnetism. In reality all forms of energy have a commonality because they are all about the living, proactive interactions and behaviours of atomic particles and of the particle structures they form.

Electricity: We cannot see energy but one of our biggest uses of it must be of it in its electrical form. We use it to light up our world and to turn the machines of industry but all the while we are only getting it to do what it wants to do. What it wants to do happens at the atomic particle level so if we want to understand it we must understand something of particle behaviour.
We learnt that a neutron becomes a proton and electron when nuclear particle energy desires are short and that a proton and electron will revert to a neutron when nuclear particle energies are being delivered in excess. The living role of the much smaller, highly mobile electrons is one of getting suitable photon energies from the environment and delivering them to a parent nucleus. A proton’s role is to establish energy links to, and to work with, an electron as part of that photon energy processing chain.
Electrons find locations in nuclear surrounds (orbitals) from which they can best interact with the environment and create strong links to protons. Those locations are understandably away from other electrons because closeness detracts from their roles and you will never find particles in a structure doing other than what is best for them. Links to protons are less strong when the locations occupied are further from nuclei as with the outer electrons that regularly link to protons in more than one nuclei in the covalent, ionic and metallic bonds we learn about in chemistry.
The metallic bonds between atoms in silver, copper, gold and aluminium structures are such that outer electrons wander about serving the needs of protons in different nuclei. It would seem that they continuously seek the best and most stable energy state for the structure they are in. We refer to this electron wandering as an “electron gas” but its electrons are not free as most will tell you. They are always intent on linking to protons and if that were not so you would be able to pull, for example, a copper bar apart.

In an electrical flow we use these outer photon processing electrons that want away from other electrons and which are intent on getting the best proton link, by giving their movements direction. We do that by providing a voltage source, like a battery, that delivers surplus electrons to one wire of a connected circuit and a shortage of electrons to its other wire.
Light speed photon interactions of 300,000 km/sec are encouraging the surplus electrons to move from the battery or other source negative terminal into our circuit wire where they cause photon linked directional electron movements between the protons in the wire. At the positive terminal there are protons desiring and encouraging photons to them and drawing to them the electrons that can feed their energy desires. Each electron directional move to serve a proton involves photon interactions that cause other electron directional moves.
We should not think of electrons continuously on the move. They are generally spending considerably more time in atoms linked to protons than they are moving between atoms. Typical progress of an electron along a wire is a half metre every hour. Our lights go on rapidly because the light peed photon interactions between moving electrons are almost immediately moving electrons in the light bulb.
An electrical load, like a heater or electric light bulb will have a structure in which its electrons are more strongly linked to protons. Many wire electrons have to gang up and jointly provide a push so as to move electrons in that resisting load that does not want to change its structure but does so because it is best for it.
Magnetism: Electrons have a property called spin. I believe it is the result of their internal energy fragments spinning. The spin direction is related to the orientation of the electron, which in turn is associated with the direction in which the electron is travelling. Some of the photon energies exchanged by interacting electrons are spun out from them, and when many electrons have like directions of motion they spin out low level photon energies in an anti clockwise direction relative to their travel.

Such photons are attracted back into the photon flows being exchanged by electrons so that the magnetic field we see circling clockwise around a current carrying wire is actually photon energies being flung out from electrons with like direction spin as a result of their many like direction motions. We see the magnetic field as circular, related to the current flow and diminishing with distance from the wire but the field is really of photon energies that spiral outward from electrons and then spiral inward to electrons.
When the current related photon energy links are rising (current increasing) the associated increasing spin energies spend longer in and grow in size the magnetic field energy, delaying their support of the current flow. When the current related energy links are falling the collapsing magnetic field energy tries to sustain the current flow. This is precisely what self induction is.

When two adjacent currents flow in opposite directions the circling photons passing between the two wires have like direction but want their own space. The photon energies interact and push one another apart and in so doing push the wires apart. When currents flow in the same direction photon flows between them are in conflict and many choose to go around both wires and that draws the wires together.
We should not think of neutrons, protons and electrons as being of fixed mass energies as they take on board and release photon energies that are general tiny relative to their mass energy. Nor should we think of photon energies as fixed. Like particle energies that interact via photons, photon energies interact by exchanging tiny portions of their energies. Magnetic photon energy interactions enable all electrical machines to work.
To close this blog let me explain the difference between magnetic materials and permanent magnets. Iron and steel are magnetic materials. They do not make good magnets. Soft iron is much used to support magnetic photon flows in electrical machines, solenoids, etc because its outer electrons will align with and support such photon flows, That alignment and support involves the electrons in soft iron ever realigning when the photon flows supported are those resulting from alternating electrical currents.
Permanent magnets are most often manufactures by sintering together powdered materials that together make for a hard, rigid particle structures. During the process many material electrons are given a like alignment by subjecting them to a powerful electromagnet. The similarly aligned, rigidly held electrons gather electrons from one direction in their quest to supply and interact with magnet proton energies. The rigidly held electrons also release to the environment, unwanted magnet structure photon energies in the opposite direction.
Whilst an energy gathering face of one magnet will seek out and be attracted to the energy releasing face of another magnet two energy gathering faces will not come together and will look elsewhere for energy. More obviously two energy releasing faces will not come together.