Illustrations of electromagnetic waves often depict the electric field (E) and magnetic field (M) as being in phase to represent the wave's properties. While these illustrations may simplify the concept for visualization purposes, it's important to understand that they are representations and not meant to depict the actual distribution of energy within the wave.
In reality, electromagnetic waves consist of oscillating electric and magnetic fields that are perpendicular to each other and propagate through space. The energy associated with the wave is carried by both the electric and magnetic fields and is continuously transferred back and forth between them as the wave propagates.
At the nodes (points of zero amplitude) of the wave, the electric and magnetic fields are indeed out of phase, but this does not mean that the energy disappears or ceases to exist. Instead, the energy is distributed between the electric and magnetic fields in a way that maintains the overall energy content of the wave.
The depiction of the electric and magnetic fields in phase in illustrations helps to convey the relationship between the two fields and their oscillatory nature. It simplifies the representation by showing a single wave that captures the essential properties of the electromagnetic wave. However, it's important to remember that these illustrations are visual aids and do not capture the detailed behavior of the wave's energy distribution.