There are many causes of grout discoloration. In general, it tends to take on a brownish hue over time, hard to remove with regular floor cleaning. Grout is a porous material, so it absorbs the dirt and water that touches it. As many people do, you probably use a bucket of water and some cleaning solution to mop the entire floor. As the water gets dirtier and you keep moving the mop across the floor, you are inadvertently allowing that dirty water to seep into the porous material of the grout. Once that water is allowed to dry, these dirty particles will become embedded in the grout due to a ritual that was actually supposed to clean it out.
In other cases, such as in shower floors, the fact that they remain wet after anyone takes a shower makes them excellent breeding grounds for mold and mildew that find the material of the grout an ideal place to grow and multiply.