Spanning tree protocol is a link management protocol which provides path redundancy while preventing undesirable loops in the network because loops are deadly to network. In STP environment, switches exchanges bridge protocol data unit between each other. By exchanging BPDU (bridge protocol data unit) switch itself select a root bridge based on low priority or low mac address of switch. By default, all switches have same priority value which is 32768. So, in this case MAC address of switches is tie breaker. Lower mac address wins her and select as root bridge.
This was the basic understanding of spanning tree protocol. We are going to cover each topic related to spanning tree in detail with practical. Please read this book carefully. It is not going to so long, will be short book which would be interesting, this will help network engineer to cover their all concepts of spanning tree protocol.