Sure it's convenient to decide when to urinate but not essential for survival or reproduction, as I understand. But just convenience is not a drive for evolution.
Does the bladder serve any essential purpose? If not why did bladders evolve?
Biology Stack Exchange is a question and answer site for biology researchers, academics, and students. It only takes a minute to sign up.
Sign up to join this communitySure it's convenient to decide when to urinate but not essential for survival or reproduction, as I understand. But just convenience is not a drive for evolution.
Does the bladder serve any essential purpose? If not why did bladders evolve?
Here are just a few points that might apply:
Since terrestrial animals presumably retained urinary bladders developed by their marine ancestors, benefits associated with terrestrial lifestyle would only provide selective pressure to retain such a feature. However, if somehow a line of terrestrial animals abandoned urinary bladders, it is not entirely implausible that even scent marking benefits could increase the selective pressure enough to overcome some peculiar opposing selective pressure.
Initially, the animal might apply scents by scratching at an area of skin irritated by urine release against some surface. Then this scratching might be preferentially located (i.e., a scent marking behavior is developed). Having such a behavior would then obvious bring benefits to storing a significant amount of urine and eventually to being able to squirt the urine (allowing the scratching behavior to fall away).
The above are just somewhat reasonable speculations about what selective pressures might encourage the development (and retention) of a urinary bladder. Hopefully, someone with actual knowledge will provide a better answer documenting established theory and evidence for how urinary bladders actually developed.
A few observations to add to Paul's:
Urinating on yourself in winter could be a fatal thermoregulatory mistake.
Urinating on your substrate could hinder locomotion.
Having a continual slick of high osmolarity fluid on your skin would be damaging to the epithelium and work at odds to the action of the kidneys.
Apparently, the urinary bladder is not unique to mammals, and is even found in fish, which one might presume can urinate at any time or even better - expel ammonia out of their gills, so why do they need a bladder?
I found the following article trying to understand what the bladder does in freshwater fish: https://jeb.biologists.org/content/155/1/567.
Apparently they concluded that the bladder is important because the kidneys let too much useful stuff (like Na and Cl ions) out, and letting it sit in the bladder for 30 minutes (as measured in the trouts in that research) allows some of these ions to be re-absorbed by the cells lining the bladder. I don't know if this is why the bladder evolved (which would have been easy - just as an enlarged cavity in front of the kidney holding some urine before it is expelled), or why couldn't a better kidney - absorbing more salts - have evolved instead. I also don't know if mammals still use the urinary bladder in this way. But once it has evolved, it is here to stay, unless it has a negative survival contribution. And as other answers suggested, it probably has positive contribution, if anything - such as avoiding leaving a strong trail of scent leading to you, or avoiding soiling your den with urine.