its quite simple, IDE cables (the original ones) had 40 pins and 40 wires corresponding. later IDE cables (from EIDE on i think) used an additional 40 wires for grounding so that higher transfer speeds were possible without data corruption (still with 40 pins of course).
I very much doubt that you have a 40 wire cable as these are basically obsolete and have been for nearly 10 years.
Example of a 80 wire IDE cable: (note the thinner wires and coloured connectors)
Example of a 40 wire IDE cable: (note the thicker wires and non colour connectors)