It could even be a slightly corroded jack or plug. Intermittently sending/lowering power/impedance/aura on the line out. The Mac's circuits interpreting that as a CD insertion and so iTunes pops open and starts playing the first thing it finds.
Strange, I know, but you must remember, your computer
does have a brain of its own! Jury's still out if that constitutes a "mind."
Just unplugging/replugging a few times is usually enough to 'clean' off any junque. If this problem persists, you might consider cleaning the prefs for what happens when an audio CD in mounted.