To solve this WiFi has RTS/CTS where nodes coordinate before transmitting.
Basically, if you have 3 nodes A, B, C, and A/C wants to talk to B, they send a request-to-send. Now B can coordinate the transmission order using clear-to-send.
Otherwise what can happen is A and C transmit at the same time and interfere.