When water draining from a tub slows as it moves through the pipes, misplaced air is forced back up through another drain, such as a nearby toilet, making it bubble. A bubbling toilet is a sign of a partial clog.
The tub drain and the toilet drain for one bathroom are branches of the same main drain line. When the main drain line is clear, the tub water flows quickly through the system pushing air in front of it when necessary. If the water hits a partial clog, it slows and moves in a gurgling manner through the system. As the slow-moving water displaces air, the air moves back through the system exiting via the nearest vent, which is usually the toilet. This makes a bubbling sound. Fixing the clog fixes the bubbling. Chemical drain treatments are not usually effective on partial clogs. A quality plumbing snake or auger clears the blockage and improves the drain flow.