The mainline can become clogged, causing backups in any of those lines. In this case, wastewater becomes clogged in your toilet when it hits an obstruction in the mainline. Also, it backs up into other nearby lines such as the drains in your shower which back up into your toilet.