The beneficial bacteria goatnad is describing are part of the nitrogen cycle. At the end of this I’ll link you an article about it, since it’s very, very important to fishkeeping. I would advise reading and learning more about it.
Beneficial bacteria, sometimes abbreviated as BB, are bacteria that live in your filter. When you have enough beneficial bacteria in your tank to keep your fish healthy, the tank is “cycled”.
Beneficial bacteria keep your fish healthy by detoxifying the water. Fish produce a waste product called ammonia, which is very toxic. Having ammonia in even small concentrations can make your fish sick and even chemically burn them. This is why you need beneficial bacteria and a cycled tank. The bacteria take the ammonia and convert it to nitrite, which is less toxic, but still bad. Then the bacteria convert the nitrite to nitrate, which is much less toxic and will not hurt your fish at low concentrations. Water changes remove this nitrate so it will not build up. This is why cycling your tank is important. It ensures that the water quality is good and that your fish stay healthy.
By changing your filter, you removed the beneficial bacteria that had grown in it. Without the beneficial bacteria to convert ammonia and nitrite into nitrate, ammonia and nitrite levels are likely elevated, which is stressing or harming your fish and causing them to gulp at the surface and rub against the tank.
[URL="https://www.thesprucepets.com/nitrogen-cycle-understanding-1380724"]https://fishkeepingadvice.com/the-nitrogen-cycle/[/URL]