Water damage to a building can be from Category 1,2 or 3 water. The type of water is primarily determined by its source.
Category 1 water is water that "does not pose substantial harm to humans"
Category 2 water is water "with a significant level of contamination"
Category 3 water is "grossly contaminated" water.
As a general rule of thumb, Category 1 water that soaks into carped can usually be removed through extraction and evaporation and the carpet can be restored.
On the other had, if Category 1 water has either been contaminated further by flowing over or through debris, or if it remains for a period of time with out being removed. Once the water has moved beyond category 1 into category 2 or 3. The carpet will need to be removed and replaced.
In this photo, Category 1 water was not addressed in a timely manner and the result was moldy carpet and pad which also contaminated the wood below.
This again reinforces the advice that in the event of a water damage, contact a professional like SERVPRO of Dubuque to make sure that all areas of water damage are identified.