The role of the enteric nervous system is to manage every aspect of digestion, from the esophagus to the stomach, small intestine and colon. The second brain, or little brain, accomplishes all that with the same tools as the big brain, a sophisticated nearly self-contained network of neural circuitry, neurotransmitters and proteins.
The independence is a function of the enteric nervous system's complexity.