In infants, this can occur because the body might not be able to clear bilirubin well in the first few days of life.
The levels of bilirubin are regulated by the liver.
This leads to the accumulation of bilirubin wherein some of them can be detected in the urine.
However, bilirubin can be toxic in newborns.