Short answer
Cat urine smell returns because the urine soaks through the carpet into the backing and the pad underneath, where surface cleaning cannot reach it. Permanent removal requires treating down to the source with an enzyme-based product, and in badly affected areas the pad may need to be replaced. Steam alone can make it worse by setting the odor.
Why the smell always comes back
Cat urine passes through the carpet within seconds and settles in the backing and the pad below it. When you clean the surface, the smell disappears for a few days and then returns, because you cleaned the visible carpet and left the actual source underneath untouched. Humidity brings it back most noticeably, which is why it often seems worse in summer.
The uric acid problem
Cat urine contains uric acid crystals that do not dissolve in water. Ordinary cleaning solutions and plain water will not remove them, which is why household carpet cleaners fail on this specific problem. Enzyme treatments work because they break down the crystals rather than trying to rinse them away.
What not to do
Do not apply heat or a steam cleaner to a cat urine spot before treating it. Heat can permanently bond the odor to the fibers and make the problem unfixable. Also avoid ammonia based cleaners, which smell like urine to a cat and can encourage them to return to the same spot.
What to do on a fresh accident
Blot with a dry white towel, pressing firmly and repeatedly, until no more moisture transfers. Do not rub, which pushes the urine further into the backing and spreads it. Then apply an enzyme cleaner made for pet urine and let it dwell for as long as the label says, which is usually longer than people expect.
When to call someone
If the smell has come back more than once, or you can smell it without knowing exactly where it is coming from, the source is below the carpet and surface treatment will keep failing. At that point it needs proper source treatment, and sometimes an honest conversation about whether the pad can be saved.