The IDE Cable
Each IDE channel uses one IDE cable, which is a rather simple affair. IDE uses a flat ribbon cable, normally gray in color, with a (usually red) stripe running down the edge. The cable usually has three identical female connectors on it: one is intended for the IDE controller (or motherboard header for PCs with built in PCI IDE) and the other two for the master and optional slave devices on the interface. The stripe is used to line up pin 1 on the controller (or motherboard) with pin 1 on the devices being connected.
Some cheapskate PC makers that ship PCs with only one IDE device save a few pennies by using an interface cable that has only two connectors, which means you can't use two IDE devices on it, unless you replace the cable with one that has three connectors. Fortunately this is easy to do, and the cables are cheap and readily available at most any store that sells computer supplies and parts (this is also a great component to buy cheap at a computer show).
While in general there is not much to connecting IDE/ATA/ATAPI devices physically, there are still some special cases and issues that sometimes come into play. An important one is that the cable design--flat ribbon cable with no shielding from electromagnetic interference--can occasionally lead to problems in some PCs. This cable design was created many years ago and was fine for the creeping transfer rates of less than 3 MB/s that were used in early IDE, but the faster PIO and DMA transfer modes can really strain against the limitations of this sort of cable.
The longer the cable, the more the chance of data corruption due to interference on the cable, and therefore, it is often recommended that the cable be kept as short as possible. The official maximum length is 18 inches, but if you suspect problems with your hard disk you may find that a shorter cable will eliminate them. Sometimes moving where the disks are physically installed will help also.
As for installation itself, the IDE cable could certainly be much better designed. Generally, the cables are not keyed, which means there is the risk of inserting the cable backwards--the red stripe on the cable should be used to align pin 1 of the IDE/ATA device with pin 1 of the controller's connector port. Also, the cable has no latching mechanism, so it is not very securely attached to the hard disk or the motherboard. If you work inside the box and apply any pressure on the cable, it can easily come loose (sometimes only partially) which will lead to device failure. Fortunately, neither backwards insertion or a partially loose cable usually cause any permanent damage--your hard disk just won't work.
When using a master and a slave device on the same channel, either device can be attached to either of the two connectors on the cable. There is a "tradition" of sorts of putting the master device at the end of the cable and the slave in the middle, but this is not really necessary.
Finally, there is one variant on the standard IDE cable that is worth mentioning. Some systems are set up to use the Cable Select line to tell which hard disk to be the master device and which to be the slave, in a dual-drive configuration. This system uses a special cable, often distinguishable by the fact that it has three connectors but the middle one is attached to the motherboard (or controller card), while normally the motherboard gets a connector at the end of the cable. This cable is specially modified and is not interchangeable with a regular IDE cable.