What are VLANs? What problems do they solve?
I'm helping a friend learn basic networking, as he's just become the sole sysadmin at a small company. I've been pointing him at various questions/answers on Serverfault relating to various networking topics, and noticed a gap - there doesn't appear to be an answer which explains from first principles what VLANs are. In the spirit of How does Subnetting Work, I thought it would be useful to have a question with a canonical answer here.
Some potential topics to cover in an answer:
- What are VLANs?
- What problems were they intended to solve?
- How did things work before VLANs?
- How do VLANs relate to subnets?
- What are SVIs?
- What are trunk ports and access ports?
- What is VTP?
EDIT: to be clear, I already know how VLANs work - I just think that Serverfault should have an answer that covers these questions. Time permitting, I'll be submitting my own answer as well.