Hypervisor and its role

Whenever a software ‘guest’ interact with the hypervisor, a os technique is used which is basically similar to the interaction software-cpu.
Those are in fact mechanisms like CPUID registers or memory mapped registers, also providing the hypervisor an interface.
Anyways before using any interface, softwares detect if they are on virtual environment by executing a CPUID with EAX = 1. Then, if the hypervisor bit is present there is the hypervisor and additional CPUID leafs could be queried like ECX,EBX,EDX.

Links
https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/feature-discovery