What is the difference between a container and a VM?
A VM virtualises hardware and runs its own kernel — strong isolation, gigabytes, and seconds to boot. A container is a process on the host kernel, isolated with namespaces and limited with cgroups — megabytes, and milliseconds to start. The trade is exactly that shared kernel: it is what makes containers cheap and it is why a kernel escape crosses the boundary in a way it does not with a hypervisor.