When the frequency of the input signal is different, the gain of the filter is also different. For example, low-pass filter, the higher the frequency, the smaller the gain, that is, it can suppress high-frequency signals.
The gain of the bandpass filter is close to 1 in the passband, and the more it deviates from the passband, the smaller the gain is in the stopband.