A VPS is a virtual operating system (guest OS) running on a main OS (host OS). You can have many guest OS' and they can all be different. They all run using the same hardware on that server, but it can be allocated to each guest OS seperately as if it was it's own physical server. It has the exact same functionality a normal OS has with nearly no problems (some software blocks VMs.) Due to the nature of VMs you can only have a very limited amount per server (assuming 32gb RAM is on the server, you could probably get away with ~256 VMs but with massive slowdowns. VMs are normally limited to only 4-60 on a server.
The difference between a dedicated server and a VPS is that other people are on the same server. They share the same resources (granted you may have dedicated resources) and normally harddrives.
The difference between a shared server and a VPS is that with a VPS you can control everything on the server and install your own software.