You’ll need a Windows license to install Windows in a virtual machine. However, they’re still running inside the virtual machine in the background.
You don’t have to use your Windows program in the virtual machine window, either-many virtual machine programs allow you to break Windows programs out of your virtual machine window so they can appear on your Mac desktop.