Your question is right. When many students ask this question, the professor can only mutter about it. Anyway, it is the result of Maxwell's equation. Electric field and magnetic field have the same phase, which is very unreasonable. We always tell middle school students that electric field becomes magnetic field, and magnetic field becomes electric field, so electromagnetic waves are formed. If so, when all electric fields become magnetic fields, the electric field is zero and the magnetic field is maximum. When all magnetic fields become electric fields, the magnetic field is zero and the electric field is maximum. So the electric field and magnetic field must have a 90 degree phase difference! In fact, if we consider the magnetic quasi-static electromagnetic field, the electric field and magnetic field do have a 90 degree phase difference. However, when encountering radiation electromagnetic field, we must add displacement current item to the equation of magnetic quasi-static electromagnetic field. At this time, the electromagnetic field we calculated, such as the far field of the antenna, the electric field and the magnetic field are in phase. In this way, we can get that the phase difference between the electric field and the magnetic field of the electromagnetic wave is 0 degrees. In fact, this conclusion is wrong. After the displacement current is added, the definitions of electric field and magnetic field have changed. The electric field and magnetic field calculated by Maxwell equation are completely different from those under the original magnetic quasi-static condition! For radiation problems, such as far field radiation of antenna, the solution of Maxwell equation must require Silver-Müller radiation condition or Sommerfeld radiation condition. When these conditions are met, in fact, the existence of absorber materials at infinity is implied, and these materials are uniformly distributed on the spherical surface with infinite radius. According to Wheeler Feynman's absorber theory, these absorber materials (the sink) will produce advanced waves. This advanced wave is also an electromagnetic field, which interacts with the electromagnetic field of the current element. In this interaction, the electric field and magnetic field are indeed in phase. However, the electric field of the current element is in phase with the magnetic field of the absorber, and the electric field of the absorber is in phase with the magnetic field of the current element (the source). In this way, the energy flow can move from the current element to the absorber.
John Cramer's interpretation of quantum mechanical transactions inherits the absorber theory of Wheeler and Feynman. Support advanced wave is the objective existence of physics. His 1986 paper was cited by 1000 people. It can be seen that it is supported by many people. But this issue is still open. Most scientists have not yet fully accepted the advanced wave. Because the advanced wave moves in the negative direction of time. This is contrary to today's causality. John Cramer thinks that photons are a handshaking process of the retarded wave and advanced wave. Recently, there is a mutual energy flow theory, which further explains that this handshake process generates mutual energy flow. Mutual energy flow is composed of retarded wave and advanced wave. The mutual energy flow can transfer the energy from the current element to the remote absorber charge. Electric field and magnetic field in mutual energy flow are in phase.
In short, to generate a magnetic field from an electric field, to generate electric field from the magnetic field, the electric field and the magnetic field must alternately reach the maximum value. This requires a 90 degree phase between the electric and magnetic fields. But to transfer energy, they must be in the same phase, otherwise we cannot transfer energy. There must be a theory to unify these two things. This problem cannot be solved under the framework of the existing classical electromagnetic theory. You must jump out of the existing framework. I mean that the issue is still open.