In a proper setup where proper protocol is observed, one of the wires is an alert wire, which a device can pull low when it wants to communicate with another device. First it checks that the wire is not already low.
If the wire is low, that means other devices are using the bus. So it waits a while, then tests the wire again.
- - - Updated - - -
That is the theory anyway. Of course there is room for things to go wrong. Two or more devices might pull the wire low at the same time. The called device is supposed to signal 'Ready to receive'.
The protocol is supposed to work perfectly, but reality is seldom perfect. I picture a help line saying, "Serial bus problems? Try a different arrangement of your devices." Or, "Are all your devices our brand? No? Then the fault must be with the off-brand device."