It’s called toilet plume.
A toilet plume is the invisible to the naked eye, cloud-like dispersal of raw, infectious sewage particles as a result of flushing a toilet. Flush particles rapidly rise out of the bowl and several feet into the air after flushing. Aerosolized droplets can remain suspended in the air for tens of minutes between users, posing an inhalation risk. These invisible particles go on to coat and spread onto surfaces like floors and counters or objects like hand towels, bathmats, or even toothbrushes.



Anecdotally it’s pretty accurate, toilets smell less when the lids are kept down. Smell strength is directly proportional to the amount of particles in the air.
I’m assuming you mean when there’s shit floating in it, because if your toilet just smells in general you need to clean it more.
Bathrooms smell after people have had a shit, even when they flush.
Bathrooms smell less when people flush with the lid down.