Greetings,
This is a feature called "port sense". This is software detection of when you plug something into an audio port on the board.
If you aren't plugging something in and the behavior is happening randomly, the following is likely:
-One or more of the ports is damaged or faulty
-You board is incorrectly mounted in the case and is grounding or shorting to something metal
or (very common) the pins on the FP audio connector for the case do not match the header pins on the board. This can be AC'97 audio or HD Audio, if the pins don't match you can get erroneous detections. Sometimes you must select the type of connector in BIOS, but this is not always true.