Hydronephrosis in dogs happens when one or both kidneys are swollen due to a buildup of urine, which happens when fluid can't properly drain from the kidney to the bladder for release. This can occur due to a variety of reasons, including kidney obstruction, kidney stones, tumors, disease, or injury.