Any material that has been colored artificially will have what is called a "dye lot". That means that all carpet that was colored at the same time, by the same colorant, will share a dye lot. When they mix up a new batch of dye, it is a different dye lot. Carpet purchased at different times usually has a different dye lot and it may not be an exact match.
The same is true for other products as well. Tile can have a dye lot. Even natural wood and stone products manufactured at different times can come from a different source causing slight variations in color.