Fish create ammonia so you have to have bacteria in the tank to eat the ammonia & make it into less harmful stuff to the fish. It takes a while to get the bacteria to grow, though, and if you put fish in too soon they'll die before the bacteria grow.
So before you put in fish you add ammonia...