When your dog pees, uric acid binds tightly to whatever it lands on: carpet fiber, grout, hardwood finish. It doesn't dissolve in water, so most soaps and store-bought cleaners just push it around instead of breaking it apart.
That's why the same spot can smell fine after a scrub and come back the moment the room warms up or gets humid. The crystals are still there, waiting.