Yes babies are incontinent when born and cannot hold their pee or poop in.
This is one reason babies need to wear diapers because they cannot control when they pee or poop and it comes out whenever and wherever.
If babies did not wear diapers then they would pee and poop all over the place.
As a baby grows and gets older the babies bladder and bowel muscles strengthen to where they can eventually hold the pee and poop in.
Most babies bladders and bowel muscles are developed enough to hold the pee and poop in when they turn 18 months of age.
Most babies were potty trained by 18 months back in the 80's and 90's.
I was using the potty by age 18 months because I could hold my bladder and poop.
When a baby is 18 months or older they use less diapers because they poop less and they pee less often.
That is because the baby is usually holding their pee in and then letting the pee out all at once at certain times.