VLANs are a way of partitioning a given network into distinct layer 2 segments as if you'd be using separate switches, so you don't have your whole network bunched together. The advantage of VLANs over separate switches is that you can run inter-switch connections as VLAN trunks (using tagged frames) instead of running dedicated links for each VLAN/segment, especially on long, expensive links. Additionally, the virtualization enables you to very easily provide a switch port into any segment anywhere in your network.
The spanning tree protocol takes care of removing bridge loops from your network when you've got multiple connections between switches - by accident or by choice. The original STP is very aged, today most installations use RSTP, MSTP or RPVST+, with the basic concept remaining the same. Essentially, STP blocks redundant links and avoids loops.
Link aggregation groups can aggregate multiple physical links into a single logical link to increase potential bandwidth (instead of blocking all but one link with STP).
Each of these concepts provides a solution for a networking problem and probably every seriously sized network uses them in combination.