For VMs it depends on whether QEMU Guest Agent setting is enabled. If so then a shutdown signal is send to the Guest Agent inside the VM (which better be running otherwise nothing happens, or the VM is killed hard eventually). Otherwise, an ACPI event is send (and you need to have booted an operating system that responds to them, or the VM is killed hard eventually).