In a traditional PC you have two IDE (hard disks and CD-ROMs) controllers.
One of them is primary, the other secondary.
To each controller you can stick one IDE cable.
To every IDE cable you can connect two devices. One of these devices has to be master and the other has to be slave.
So those connections identify a hard disk or a CD-ROM device. Primary master is the device that is connected to the first IDE controller and is set to be the master.
Secondary slave is the device that is connected to the second IDE controller and happens to be set to slave.