I've been wondering about this issue, just as something to think about. The question really is, knowing that beneficial bacteria bind to every surface of the tank, and knowing that there is a lot of surface area in the biomedia in the filter, what percentage of the total of the beneficial bacteria resides in the filter biomedia?
I guess this would depend on the tank size, with a larger tank with a filter of the same size (for the sake of argument) bearing less of a percentage of beneficial bacteria. I have an Aquaclear 30 HOB on a 10 gallon tank.
My uneducated guess is, especially in a moderately to heavily planted tank, that most of the bacteria are in the tank, especially as tank size goes up. A conclusion would be that water circulation is very important. This would be a factor in where in the tank bacteria can do their work and participate in the Nitrogen cycle.
One more thing - plants use nitrogen in ammonia, nitrite, and nitrate, competing with the beneficial bacteria - outcompeting I would say. I believe that plants get the nitrogen first and hold onto it, then the bacteria get the rest, if any, eventually showing up as the end product of the Nitrogen cycle, Nitrate.
Back to the original question - where do you think the majority of beneficial bacteria is, in the filter or in the tank?