Putting it simply, it consumes ammonia that is produced by fish, turns it in to NitrIte then a different type of bacteria consumes the NitrIte and turns it into NitrAte.
Without Bacteria your fish would be swimming in their own p*ss and sh*t!! lol
Im sure someone else can explain it in a more scientific way, I like going straight to the point.