As animals, fish inhale oxygen and release carbon dioxide, like we humans do. Carbon dioxide is a weak acid and affects the pH. They also excrete ammonia as waste through their gills. Ammonia is a weak base and also affects pH. But the amount of CO2 and ammonia that fish produce are smaller influences compared to your rocks, tap water chemistry, decaying fish food, and other factors.