Most of us use some sort of mechanical filtration (foam) and some form of bio. Bio can be many different things. Biomass, ceramic rings, matrix, bio balls etc. Essentially something with a large amount of surface area to colonize the beneficial bacteria needed for the nitrogen cycle. Some believe in running carbon others do not
Your bio is removing ammonia and nitrite with end result being nitrate.
Foam is mechanical filtering out solid matter from the water.
What type of filter are you using?