VLans provide a way for you to segment you network into smaller broadcast domains REGARDLESS of where the computer is located on the network. Usually this is done based on function and security.
For example:
If i had a three story building with : Administration, Accounts and Servers on each floor.
Normally is some cases each floor would have a switch and that switch connected to a main router for the building. So each floor is one network, all broadcasts go to everyone on the floor regardless of function.
With a vlan we can breakup those domains into functions. So all Administration computers, even though are on different floors and switches, can be there own network. Same goes for accounts. Servers get there own private network even though there on completely different floors .
VLANS also provide added securitry so if you wanted the Accounts computers to have no access to administration computers you can.
To put this in a school type example. If you have wireless access points all over campus you can have them in there own vlan (and subnet). A rogue laptop on your wireless wont tear down the whole system. With added vlan security you can restrict wireless to just being able to access the internet and nothin else on campus.
At my school we have IP security cameras all over the campus from the front gate to the back. Plugged into switches all over the place. With my vlans they're all in the same network and subnet. Nice. Since these cameras are heavy broadcasters those broadcasts only get received by the other cameras not the whole of my network.
The cool thing is I can plug a computer into one port in my switch, another computer into the port right next to it and they will be on two completely different networks (or subnets).
Hope that provides a clear example of what vlans are and can do.