I wonder how virtualization software such as VirtualBox or VMWare Workstation works? How can they create a virtual environment that is taken as a separate computer by operating
In the simplest sense, a virtualised environment is to a native environment, what an interpreted language, like PHP, Javascript or Basic, is to a compiled language like C, C++ or assembler.
When a compiled binary executes, the binary machine code, is passed straight to the CPU. However when an interpreted language runs, the language application reads in the code, then it decides what that meant and execute binary procedures to reflect that.
So virtualisation software like Qemu, while compiled to run on, say an x86 processor, will read the binary file, intended for say a Mac, and it will interpret the binary it receives, switch it from big, to little endian, and then know that op code X on mac corresponds to op code Y on x86, and that op code A on mac, doesn't have an equivalent on x86, so will need to call function B on x86 and so on.
The really clever bit, is the hardware interpretation, where someone has to write a driver, that will run on Qemu, on x86, but will present an interface to the Mac face of Qemu, to make Mac applications think they're talking to Mac hardware.