In all likelihood, the AC adapter you're referring to uses a switching power supply to step down mains voltage to a low DC voltage.
There are two ways, broadly speaking, to convert a high AC voltage to a low DC one. The first is like this:
simulate this circuit – Schematic created using CircuitLab
Here, a mains-frequency transformer first steps the voltage down, then it's rectified and filtered and either used as-is or regulated to a more stable voltage, whatever the circuit requires. This is how most power supplies were made in the 1990s and earlier.
But mains-frequency transformers, as a consequence of the low frequency at which they operate, have to be quite large, heavy, and expensive. What if you could make the AC higher frequency, to the point that you could use a tiny transformer that weighs only a few grams and costs less than $1? Well it turns out you can, and most power supplies today are much smaller, lighter weight, and more efficient than the ones of yesteryear as a result:
simulate this circuit
Here, the mains input is first rectified to DC, then a switching element (usually a MOSFET) chops up that DC by rapidly (hundreds of kHz or even a few MHz) switching between the rectified mains and ground, feeds that into a much smaller (and cheaper, and lighter) transformer, then it gets rectified again to the voltage that your device needs.
You might think the second method sounds a lot more complicated, and you'd be right--I've actually simplified the circuitry here by a pretty significant margin to make it easier to understand. But all of its components together do add up to be significantly cheaper and more efficient than a mains-frequency transformer, so this is the preferred method today.
There is actually a third common method that doesn't use a transformer at all, known as a capacitive dropper. These are very simple, but should never be used outside of very particular circumstances because they're inherently significantly more dangerous than any power supply that uses a transformer. The transformer gives you galvanic isolation from mains, which limits how badly you can injure yourself or others if something goes wrong; a capacitive dropper lacks this limitation.