Not everyone uses an OEM licence.
Anyway these licences are checked by Windows: if you move a drive from an activated machine to another, there will be another activation for the new license.
And both activations are kept even if only one is used at once. If you swap again, there's no reactivation needed as the activation keys and data are still there in the registry stored on the system disk.
This process is safe, and frequently used for the maintenance: you can install or repair Windows on a machine, then connect the installed disk to another one.
If you don't have a second licence for the new machine, Windows will work for one month then will work in limited mode (with no user custimization of the start menu and desktop, and a basic access to the preinstalled web browser of the system (Edge on Windows 10), and the System control panel where you'll find the activation button.
If your Windows is not activated, your user login sesssions will be limited in time (Windows will disconnect you after about one hour, closing all your desktop apps, and possibly refusing to launch some third party apps, notably those requiring a secondary background user profile). the UAC profile and other security settings will also be forced to its defaults in this mode. You may also not be able to connect to the Windows domain, or will not be able to use some remove services on your LAN, or will not be able to use some online services on the web. The solution will be to buy a second licence and activate it for the new machine to restore the full functionality.
Note that some third party apps also require their own activation based on the hardware, their licence may not work (and not all of them can keep a separate store for two licences): typically they identify your machine using the MAC adress of your Ethernet or Wifi adapter, or will attempt to use the volume id of your first hard disk (not necessarily the system disk). Some of them are identifying your BIOS number, or some internal ids of some other devices from the PCI configuration (display adapter, RAM modules, or the internal CPU id if it is readable).
There's no rule on how machines are identified: Windows preferably uses the BIOS identifier encrypted and stored in Flash memory by the OEM maker of your motherboard: this may cause sometimes issues with some machines when you upgrade your BIOS as it may invalidate your licence (with some broken BIOS flashing tools), or if your motherboard is damaged and you need to replace it (even if it's the same model), because the BIOS number will be different (even if you've kept all the rest, including CPU, RAM modules, display adapter, network adapters and disks, which all have their own hardware ids, Windows actication may be needed again, or you'll need to negociate with Microsoft that may want you to run a "Genuine Windows" activation agent to check the other components; note that these activations may be checked again to make sure that the previous machine is no longer used with that licence). Users are reselling their machine because they have bought a new one (but without a new Windows licence) and want to reuse the old licence on the new machine.
Other vendors are using various tricks to identify the machine for their own software licence, including trying to locate other installations of the same licence on your LAN (or virtual LAN if running Windows in a VM) using some broadcast to discover them, some of them will check that their licence is active because they will first connect the app to an online web service that will only accept a single active session using a given licence (you have to choose the machine or virutal machine on which you'll run the software, the second live instance may refuse to run).
Note that *some* licences bought online on the Microsoft site ARE transferable from one machine to another. They are not tied to the OEM machine identification (this is the case for licences bought from Technet or MSDN, or volume licences tied to an enterprise domain running their own licence activation subsystem installed on an company's Windows server), but these licences cannot be activated and used simultaneously (this will be checked sometimes automatically on all machines that have an internet access, or during the execution of Windows Update, with the "Genuine Windows" program which is regularly updated).