How do the Spinal Nerves know what to do? If there are so many nerve fibers surely they can get their messages mixed up?

Nerves called the spinal nerves or nerve roots come off the spinal cord and pass out through a hole in each of the vertebrae called the Foramen to carry the information from the spinal cord to the rest of the body, and from the body back up to the brain.
The spinal nerves carry information to and from different levels (segments) in the spinal cord. Refer to “Can you explain the make-up of the spine in simple terms?”
Both the nerves and the segments in the spinal cord are numbered in a similar way to the vertebrae. The point at which the spinal cord ends is called the conus medullaris, and is the terminal end of the spinal cord. It occurs near lumbar nerves L1 and L2. After the spinal cord terminates, the spinal nerves continue as a bundle of nerves called the cauda equina. At this point the bundles of nerves look like a horses’ tail.
There are 31 pairs of spinal nerves which branch off from the spinal cord. In the cervical region of the spinal cord, the spinal nerves exit above the vertebrae. A change occurs with the C7 vertebra however, where the C8 spinal nerve exits the vertebra below the C7 vertebra. Therefore, there is an 8th cervical spinal nerve even though there is no 8th cervical vertebra. From the 1st thoracic vertebra downwards, all spinal nerves exit below their equivalent numbered vertebrae.
The spinal nerves which leave the spinal cord are numbered according to the vertebra at which they exit the spinal column. So, the spinal nerve T4, exits the spinal column through the foramen in the 4th thoracic vertebra. The spinal nerve L5 leaves the spinal cord from the conus medullaris, and travels along the cauda equina until it exits the 5th lumbar vertebra.
The level of the spinal cord segments do not relate exactly to the level of the vertebral bodies i.e. damage to the bone at a particular level e.g. L5 vertebrae does not necessarily mean damage to the spinal cord at the same spinal nerve level.