Virtual LANs are there to secure and segregate networks and overall make the network more manageable.
Manageability
With a VLAN you can create a logical broadcast domain. This means the physical layout doesn't necessarily need to be the logical. For instance you might virtually have 3 servers attached in one VLAN. This would seem as if they were on the same switch. But physically they can be on 3 different switches.
This means that if you ever need to move the machines around physically, the logical design still can stay the same. This means you need to stress your routers less since there is no special route traversing necessary to get to the other machine.
secure and segregate networks
VLANs provide a certain level of security. If you have one switch to which all your machines are connected, but you do not want the other machines to reach each other, you can just use VLAN's to devide the network. In practice this might be that you use ports 1-5 for your critical server machines, ports 6-10 for employee PC's and 11-15 for a guest network. Each of them are put in a different VLAN and can't reach eachother even though they are physically on the same device.
Inter VLAN routing
Now what if you want to let some VLAN's talk to each other? Well then you need inter-vlan routing. This means you add a router (or use a level 3 switch) to provide this functionality. A common practice is to use a router on a stick:

You can see a trunk as an uplink, it can run between multiple switches/routers. A trunk is a special line over which a number of VLAN's run. You can have multiple trunks on once device.
(I come from a cisco background)