Why does dog urine smell?
A: It is the bacteria feeding on the pet urine.
"In order to consume food, bacteria produce enzymes, which break the larger particles of their food into small units, and at some point the urine can smell bad as the urine ingredients are degraded and released as putrid gases"
https://cleanfax.com/diversification/the-remediation-of-urine/
How Do I Get Rid Of The Pet Odour?
A: You have to kill the bacteria.
The safest way to remove pet odour is with an acid. It liquefies the urine salts and reduces the pet stain. You can also apply hydrogen peroxide to the pet stain however it is not recommended for delicate fibres such as wool and cotton.
How Deep Has The Urine Soaked Into The Carpet?
A: It depends on the size of the dog. A larger dog has a larger bladder which may soak into the backing of the carpet , underlay and possibly the subfloor. This can be a big issue if your subfloor is a hardwood floor or unsealed concrete.
If the urine does make it’s way down into the subfloor it will need to be cleaned and sealed.
Note: If you do decide to replace your carpet please have the subfloor treated. I have seen customers put in brand new carpet without treating the odour in the subfloor and the smell was still there.