Why do we use Docker on top of a virtual machine?

Generally, we use Docker on top of a virtual machine to ensure the isolation of the application. On a virtual machine, we can get the advantage of the security provided by the hypervisor. We can implement different security levels on a virtual machine. And Dockercanmake use of this to run the application at different security levels.