Would someone please explain how 'gain' functions?


I would appreciate it if someone would explain how gain functions in audio equipment?
I have a 'gain' setting in my phono preamp.  A Gain value (along with loading) is recommended by a cartridge manufacture (MC) for proper function and playback.  So what exactly is 'it' in the electrical world?  What am I changing when I select a particular 'gain'.

When I play my records some are louder on the same volume setting then others.  I find this to be the case on many MFSL and other high quality 180 gram / 200 gram half speed master recordings vs the old school original stamped LP's.

Then there is the difference between loudness of my CD player vs my turntable.  The CD player being much louder than any vinyl playing at the same volume setting.  When I create a CD on my computer with online purchased songs some are very loud and some sound just normal to me at the same fixed volume setting.  I notice the same phenomenon with my Ipod.  Some songs are normal at a volume setting then some songs sound louder.   

I'm not trying to 'fix' anything, just looking for a understandable explanation of the term 'Gain' and how it works.   
Thanks in advance!
quincy
My cheap phono pre-amp has a gain control and a little light that goes from green to red depending on the signal. I never know whether to set it so the red flickers from time to time or never.
@N80, I would think the manual should and hopefully would answer that.  Or if not, a call or email to the manufacturer would seem to be in order.

Regards,
-- Al  
Al, thank you. With my current integrated minimum is at about 6 o'clock and max I don't know. Anything beyond 11 o'clock is unbearably loud with much higher distortion level. My normal range is 7 to 10. So I guess I would be fine if I still used the same amp and speakers.
Hi,  this is Quincy again.

Thanks to all who posted their helpful responses.

So, I have a few more general questions.....

1.  Gain is measured in Voltage dB....what is SPL dB?

2.   Equipment has different Gain voltages.  CD player may have 1 volt.
Why doesn't the pre amp 'level out' or balance all of these different            incoming signals?

4.  Dynamic Range and Dynamic Compression of the signal (Assume both analog and digital) have a major effect on perceived sound levels.  I may have been confusing Gain with these two other items?

5.  On a analog record DR and DC would be either larger or smaller (peak to peak) sound waves embedded in the record groove side walls?

6.  How does DR and DC get put into a digital recording which is really just a bunch of ones and zeros?

5.  Sound is air pressure movement.  How does atmospheric pressure, altitude above sea level, and humidity affect Gain in general?