Why does my kitten's urine clean my carpet?
Urine (human and animal) contains ammonia, paricularly if it's left for a while, e.g. if you didn't notice it at first.  Ammonia is used in carpet-cleaning products.  In fact it's been used for stain-removal since Roman times.
You might want to track down an ammonia-based carpet cleaner, but use it when you can open all the windows and sit outside for a bit afterwards.