The primary cause of gray baby syndrome is the incapacity of a newborn's liver to adequately metabolize chloramphenicol. In adults and older children, the liver efficiently processes this drug via glucuronidation, a pathway that is underdeveloped in neonates. As a result, when chloramphenicol accumulates in the bloodstream, it leads to toxic levels, causing the symptoms associated with this syndrome.