Compact Cassette/Audio Tape:
A tape smaller than the VHS. Music is stored on the magnetic tape that can be turned in a certain direction by two small spools. You can reverse and quicken the speed of the tape, but is often calibrated by the factory and not the users. The encoding of the sound is analog. So, it is not digital.
You could not go to a certain track so you had to rewind or fast forward the tape until you reach the certain track. Also, the tape tends to be damaged easy and could degrade overtime, but not as much as the early 8-track. Cars in the 80s and 90s have players embedded in the dashboard to play tapes.
Commodore 64s could play audio cassettes and the data in the magnetic tape can be loaded and you can play games with it, but it takes a long time to load.
CD:
A plastic disc/optical disc that stores audio data/any type of data in bumps/pits that have the size of micron. In order to read data, a laser moves and hits bumps, and plays sounds. It has a sampling rate of 44.100 khz, and is digitally encoded. Certain CDs can be record-able and often bought for cheap, just like an empty and record-able Compact Cassette.
It can be scratched easily and oil from fingerprints etc. can make the CD dirty and make some few skips, but can take more damage than a vinyl disc. CDs can also be loaded up on the computer. The PlayStation had CDs as a medium to play games. Sega modified the CD, made the GD-ROM for their short-lived Dreamcast system. They also used CDs for their Sega Saturn system.
Anyway, there is one thing and that CD is better than Compact Cassette, nuff said. It can store more data (700 MB maximum), has better sound quality due to sampling rate, and is more tolerant to damage, and can be used for other purposes than for just listening to music.