From the same article posted in the question, the symptoms section identifies when to consult a doctor:
When to see a doctor
Most children outgrow bed-wetting on their own — but some need a little help. In other cases, bed-wetting may be a sign of an underlying condition that needs medical attention.
Consult your child's doctor if:
Your child still wets the bed after age 6 or 7
Your child starts to wet the bed after a period of being dry at night
The bed-wetting is accompanied by painful urination, unusual thirst, pink urine or snoring
The second bullet point is of particular interest because it describes the distinction between primary and secondary bedwetting:
There are 2 types of bedwetting: primary and secondary. Primary means bedwetting that has been ongoing since early childhood without a break. A child with primary bedwetting has never been dry at night for any significant length of time. Secondary bedwetting is bedwetting that starts up after the child has been dry at night for a significant period of time, at least 6 months.
Primary bedwetting is typically a developmental issue, although it can be tied to medical conditions, which is why you should check with your pediatrician if it continues beyond age 7.
Secondary bedwetting seems to be more frequently a symptomatic issue:
Urinary tract infection: The resulting bladder irritation can cause pain or irritation with urination, a stronger urge to urinate (urgency), and frequent urination (frequency). Urinary tract infections in children may indicate another problem, such as an anatomical abnormality.
Diabetes: People with diabetes have a high level of sugar in their blood. The body increases urine output to try to get rid of the sugar. Having to urinate frequently is a common symptom of diabetes.
Structural or anatomical abnormality: An abnormality in the organs, muscles, or nerves involved in urination can cause incontinence or other urinary problems that could show up as bedwetting.
Neurological problems: Abnormalities in the nervous system, or injury or disease of the nervous system, can upset the delicate neurological balance that controls urination.
Emotional problems: A stressful home life, as in a home where the parents are in conflict, sometimes causes children to wet the bed. Major changes, such as starting school, a new baby, or moving to a new home, are other stresses that can also cause bedwetting.
Children who are being physically or sexually abused sometimes begin bedwetting.
Note that the webmd article does indicate that bedwetting has a tendency to run in the family, and that most children stop wetting the bed at around the same age as one of their parents did.