Each cable will accommodate two devices. One will be master (primary), the other slave (secondary). The primary device on the first IDE cable will always (usually) be your boot device.
Adding stuff to your computer: If you add a DVD on the same cable as your existing HD, then the DVD will be slave, as you need the HD to boot from. Adding the CD to the other cable (without anything else on that cable) it will be master, as the first device on a cable should be the primary one.
The other way to do it would be to have both optical drives on the second IDE cable, with one set to master and the other to slave. But for copying purposes this might not be ideal.
Cable select could be used on all the drives, given that the hardware is new enough to support it. With this setting the chosen plug on the cable determines if the device is master or slave (I think). I never use it. Prefer to set it right myself so the computer cannot c*ck it up