CSMA / CD (Multiple Access with Bus Detection with Collision Detection) helps hosts determine when packets are sent in a shared network segment and how conflicts are detected if they occur. For example, in a centralized network, two devices can send packets at the same time. This can cause a collision. CSMA / CD allows devices to "discover" the cable to ensure that another device does not transfer packets at this time. However, if two devices detect that the cable is clear and send packets at the same time, a collision may occur. In the event of a collision, packets must be re-transmitted after a random period of time.
Consider the following example:
In the previous topology we have a network of axes. Host A tries to communicate with Host B. Host "discovers" the cable and decides to send packets. But at the same time, Host C sends its packets to Host D and the collision occurs. Transmitters (Host A and Host C) detect collision and resend the packet after a random period of time.