There are two different sets of colours available. In leiu of better terms, let's call them literal colours and system colors.
Literal colours are fixed and always stay the same. If you set the panel to gray, it will always be gray.
System colours are dynamic - they're named for a purpose and change with the system theme. For example, the system colour "Control" is the colour for control backgrounds. Usually, this is gray, but it can change.
In Windows.Forms, Literal colours are available as static properties on System.Drawing.Color, while system colours are available as static properties on System.Drawing.Systemolors.
I think things are slightly different with WPF, but that's not an area I'm yet familiar with.