It is to match the input level of the amp to the output of the head unit. For example, it allows you to set up the amp where when the head unit is at 1/2 volume, the amp will also be at 1/2 volume (give or take a little). To set it, turn the gain fully counter-clockwise, and turn the head unit up until you hear distortion. When you hear distortion, turn it back down to where it just stops. Then, turn the gain up until you again hear distortion, and again turn it down until it just stops.
Yes, there will be a difference. Every head unit is different and each has to be set accordingly. Even the exact same model may have little differences, but you probably wouldn't notice them as our ears aren't sensitive to such a minute amount of distortion.