There are many causes of incontinence. Some animals are born with abnormalities in the urinary tract. Others develop problems later in life - neutered bitches are more at risk of developing urethral problems and, in entire male dogs, incontinence is often related to prostatic disease. Sometimes back problems can cause pressure on the nerves to the bladder resulting in incontinence.
Some breeds and types of dog are more at risk of developing incontinence. The most common cause of urinary incontinence is urethral sphincter mechanism incompetence (USMI). This is most often seen in female, large breed dogs and often those breeds that have docked tails, eg Old English Sheepdogs and Rottweilers. In animals with USMI incontinence most often occurs when the dog is lying down.
Some animals have an underlying problem with the urinary tract so that it doesn't work as well as it should. However, they are able to control urination unless something else happens to make extra work for the urinary system. If these animals drink a lot they develop a very full bladder that puts extra pressure on the urethra.