system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What is the mechanism that wireless devices use to generate electromagnetic waves, millions per second?

I heard it has something to do with electrons moving back and forth really quickly..how does it do this exactly?
gpt
Electromagnetic waves generated by our current generation wireless technology (what are called "transverse electromagnetic waves" or TEM), are thought to be alternating areas of (relatively) strong electric field followed by strong magnetic field followed by strong electric field, etc. The change of intensity of one type of field leads to the creation of the other type like ripples of water on a pond (this phenomenon was explored by Michael Faraday, and described mathematically by James Clerk Maxwell, Oliver Heaviside etc.)

It follows from their discoveries that charging up a metal conductor (like an antenna) and discharging it rapidly can lead to these TEM waves rippling outwards. Charging and discharging is actually just another way to say "electrons moving back and forth" (though they actually move quite slowly), and every time these electrons change direction, another wave ripples outward.

How do you charge up and discharge an antenna rapidly? Well you need some way to connect it to the positive side and then negative side of a battery (or other source of voltage) millions of times per second. The positive side will suck electrons off the antenna, and the negative side will pump them back on the antenna (this may sound backwards but isn't, electrons are negatively charged and hang out in greater numbers at the negative terminal of a battery).

Modern transistors (essentially electrically controlled switches) can switch on and off millions (and billions) of times per seconds, and so are great for this. To do this switching, they only need a small electrical control signal, which is changing exactly as fast as you want the antenna to charge and discharge. These transistors that do the actual charging/discharging are called "amplifiers", because they amplify the power of the small control signal to give the antenna a stiff charging and discharging with each cycle.

But how do you make a small electrical signal change millions of times per second? For that you need what we call an "oscillator".

In modern radios this is usually a special arrangement of transistor amplifiers put in feedback with each other to create an electrical "ringing". You know how putting a microphone up to a speaker causes a screeching sound? That's what we call feedback. Same idea, just a much higher pitch screech. We can even change the pitch of the screech electrically by using neat tricks. One circuit that does this is called a Voltage Controlled Oscillator (or VCO), and it uses a neat trick with a diode that lets us easily pick different "channels" to broadcast on (you know, all those different spots on your radio dial).

VCOs are not known for making really pure and pitch-perfect tones however, so like a singer before a performance we tune them up. In the radio world, our electrical tuning forks are made from precisely cut pieces of quartz crystal surrounded by yet more transistors. The transistors help keep the fork ringing as long as there is power in the battery. We use precisely cut quartz for this, because when tickled properly it can "ring" electrically with a very pure tone (and pure tones are very important - they help the cell tower pick your phone out from the crowd).

So there you have it. Today's wireless devices start with a pure tone generated by a quartz crystal tuning fork, that is used to tune a screeching-feedback VCO. The (now much cleaner) tone from that VCO is then used to control amplifying transistors, that charge and discharge a piece of metal, that causes ripples of electromagnetism to radiate outwards.