This article is from the Ethernet FAQ, by James Messer James@NetworkUptime.com with numerous contributions by others.
Spanning tree is a protocol defined in IEEE 802.1q to prevent
bridges from creating network loops. Using the spanning tree
protocol, bridges communicate to each other and disable certain
ports/segments to prevent looping of packets.
Many implementations of the spanning tree protocol are configured so
an alternate path is available to network traffic, should the
original path become disabled.