The idea of “unity gain” is essentially that when passing audio through a piece of gear, if the output level is the same as when the device is not in the signal path, “unity gain” has been achieved — input equals output, level-wise. Basically, you put one volt in, you get one volt out, which is said to equal a gain of one or “unity.”
Establishing this balance between pieces of audio equipment; whether it is between a guitar amplifier and a stompbox, an outboard EQ and your DAW, or something more complex, will ultimately result in a cleaner overall signal devoid of unwanted distortion and feedback. That being said, certain pieces of gear, such as preamps, are used specifically for boosting gain and should be used as such. However, first establishing unity gain allows you to have control over what is being boosted or cut and by what amount, instead of audio via random circumstance.
When recording in a studio environment or mixing live sound, establishing unity gain between all of the various elements, such as multi-input consoles, outboard preamps, effects, dynamics processing, multiple amplifier and crossover networks, digital recorders, summing buses, mastering processors, and a host of microphones and DIs can be a long, involved process but is of paramount importance. With so many elements involved, if every piece lost or added even 1/2dB of gain, you could have signal-to-noise ratio and headroom issues; not to mention the fact the last pieces in the chain would have serious gain problems by being either over or underfed the proper level.
Beware: Just because a piece of audio equipment has a center detent on a gain or output knob does not mean that setting it there will establish unity gain with other pieces in your signal chain. The center detent is usually close to halfway through the usable range of a piece of gear, which may be a fine place to start. However, using metering and more importantly your ears will help ultimately define that perfect balance known as unity gain.
A gain of factor 1 (equivalent to 0 dB) where both input and output are at the same voltage and impedance is known as unity gain. — Wikipedia