It certainly may have other factors underneath but, generally speaking, many sites, Wikipedia included, simply redirect the User to a different version of their website if on mobile. Here, a random example from my recent history list (don't question :p):
This redirection occurs after a condition is satisfied and this condition is based upon the User-Agent, one of the many Request Headers with a (long) string of characters the browser sends to the server of a site which tells a bit of the User visiting the Page. E.g:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
With this, the Wikipedia, for example, knows I'm visiting them from a Windows x64 PC using Google Chrome.
If the condition that triggers the redirection is based on the User-Agent, if you modify it manually you can pretend to be using different settings.
For Google Chrome, I've tested User-Agent Switcher for Chrome which allowed me with a few clicks on the icon added near the address bar to change my User-Agent to a mobile one. Among the available options, you can find different browsers and even mobile Operating Systems (Android, iOS and Windows Phone).
By clicking, for example in Android and then picking Android KitKat my User-Agent string became:
Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36
There are different methods of validating if a User-Agent is from someone on mobile or not, but the most common is that Mobile expression near the end. Two clicks, the page reloads and I'm sent to Wikipedia Mobile.
By default, you'll have to manually define the User-Agent you want to use and it's a global change, meaning it'll apply to any subsequent tabs/windows you open but if that's a burden you can also make this change individually, by domain.
In its options panel, under Permanent Spoof list you can set wikipedia.org as domain and pick one of the mobile options from the dropdown and from then on, every time you visit a Wikipedia page you'll be redirected to the mobile version.
Although it's not the same extension, I've found this one for Firefox. It has a nicer UI in which you define everything in-place, Mobile/Desktop Device and an Operating System. It also allows the change to be per domain or just specific URLs, by defining them as a comma-separated list in the field below the icons.