Noise gates and expanders are mostly, though not entirely, noise management devices.
Noise, at least unwanted noise, is the enemy of all stages of the recording process.
There can be a number of causes:
* recording environment
* the recording/processing circuitry
* storage medium.
When you are working with multi-track recordings the problem of unwanted noise multiplies. Recorded noise on each track adds together, raising the overall noise floor. The noise level can go well passed audible and become a really annoyance, completely ruining an otherwise good recording.
Once it is part of an electrical signal it is really difficult to remove noise without altering the tone of any recorded instrument. It is much better to side step the problem entirely and manage the signal noise before you start recording. It is a smart idea to lower the level of noise contributed to the mix by each track. If there is no signal content between notes, then at that point that track is only adding unnecessary noise to the final mix.
Take a look at this really useful article about noise gates and expanders.
https://bit.ly/3r9Y24g