A virtual machine is just an app—a piece of software that runs on your computer. Specifically, it is a program that emulates/simulates another computer. It allows you to run old operating systems as a program on top of a newer computer.
For instance, I have a MacBook and macOS and dragon doesn't work on macOS. But I can run Windows XP as a program within macOS. And on top of that windows XP I can run an old version of Dragon NaturallySpeaking.
There are different programs that work as virtual machines. The one I am using is called virtualbox. Others are Parallels, VMware, qemu...