I don't know the historical reasons for why the common BW limit is 20MHz and not some other frequency. But as for how:
I believe some scopes do it in software*, but more commonly, it's switchable hardware filters. (Yes, most bandwidth upgrades simply alter which hardware filter is enabled when it's not set to 20MHz mode. So the Rigol DS1000Z series, for example, is 100MHz hardware, with selectable 20, 50, and 70 MHz hardware filters. But the user interface only exposes 20MHz and whatever your licensed maximum is.)
*The R&S MXO4 I have at work has 20, 50, 100, 200, 350, 500 MHz, and 1GHz bandwidth filters (almost certainly in hardware) on hardware fundamentally capable of 1.5GHz. But it also can apply a bandwidth filter at arbitrary cutoff frequencies as a math channel.