How does a laptop power adapter automatically "adapt" to world voltages and frequencies
First, most (maybe all) laptop power adapters are offline flyback converters.

Here's a simplified flyback converter:







simulate this circuit &ndash; Schematic created using CircuitLab

When SW1 closes, D1 gets reverse biased so no secondary current flows. This results in an increase of primary current linearly and then energy storage in the primary of XFMR1 according to \$\frac{1}{2}LI^2\$ (\$I\$ is the peak value of that linear-ramp-shaped current waveform).

When SW1 opens, all the polarities on the transformer reverse, D1 conducts and the energy stored in the primary winding of XFMR1 is transferred to the secondary (i.e. load).

NOTE: Actually, XFMR1 acts as a coupled inductor, not a transformer.

The voltage across the load is sensed and stabilized by the feedback &amp; control unit by controlling the on-time duration of SW1.

Let \$t_c\$ be the on-time duration of SW1 and \$f\$ be the switching frequency, so the duty cycle can be defined as \$D = t_c f\$ (Note that the switching frequency can be between, for example, 20kHz and 300kHz).

The output voltage can be calculated as \$V_o = D * V_{DC} \$.

So, if \$V_{DC}\$ gets too low then the FB&amp;C unit increases \$D\$ (By the way, \$D \$ cannot be higher than 50%, theoretically. In practice, most designers limit it to around 45%). Likewise, if \$V_{DC}\$ gets too high then the FB&amp;C unit decreases \$D\$. The transformer is designed according to minimum and maximum input voltages so that the circuit can work between those input voltages (Input voltage adaptation).

Since mains AC is rectified and filtered to obtain a DC voltage (because the flyback converter needs DC on its primary), the mains frequency does not matter a lot (Mains frequency adaptation).