Urine bags collect urine from a catheter, which is a tube connected to the bladder, for people who cannot urinate naturally due to medical conditions like urinary incontinence or retention, or after surgery. They are also used to collect urine samples from infants or for monitoring urine output in intensive care units.