Those two inches of water at the bottom of your toilet are the only thing between your bathroom and the sewer.
Early flushing closets sealed the drain with a flap, which jammed open and let sewer gas into the house. In 1775 the watchmaker Alexander Cumming patented a pipe bent into an S, so water settling in the bend became the seal. When plumbing reached every floor, water falling down shared pipes sucked those seals away, until vent pipes through the roof let the drains draw air from the sky.