It doesn't. You need to restart first and use the boot prompt to get to Disk Utilities then you would be abe to delete any partition on the computer. Or maybe this person used the Windows side or another macOS install to delete the partition. Either way you can't delete a partition while you are actively running macOS on that partition.Why would the Mac let you easily do something like this?
Windows has a similar process as well. You have to be actively trying to modify your partitions in order to slip up like this. The best that the OS can do and it does do is ask to confirm if you want to go through with the operation.