This is caused by new pond/tank syndrome due to a build up of toxins such as ammonia and/or nitrite. It takes a new filter at least 6-8 weeks to mature – that is for the nitrifying bacteria to start to colonize the filter media. Ammonia is freely excreted by fish as part of normal metabolism and during this maturation time the levels of these toxins can rapidly build up to dangerous levels. It is important to only introduce only few fish at a time during this period, and constantly monitor (at least twice weekly) water quality for ammonia, pH and nitrite.
For more details see the nitrification page.
If levels do rise they should be reduced by carrying out a 10 -50% water change (depending on the degree of pollution). For example, if the ammonia is twice the acceptable level, a 50% water change will only reduce it back to an acceptable level, whereas a 25% water change would still leave it 1½ times the acceptable level! Obviously, smaller more frequent water changes are better. As conditions improve the frequency of testing and water changing will slowly reduce. Once levels have stabilized only introduce a few new fish at a time as every new addition will increase the ammonia load on the filter.