This is directly connected at the upper level of the oesophagus. One should realise that this may be a source of toxins being introduced into the intestinal environment. Food entering and leaving the stomach is regulated by two sphincters. A sphincter is a ring-like muscle which opens and closes a natural orifice. Imagine it as a drawstring on a cloth bag.
Food entering the stomach is under the control of the cardiac sphincter.
Food leaving the stomach is governed by the pyloric sphincter. These sphincters are controlled by the nervous system. There may be uncoordinated opening and closing of these sphincters which can be the cause of much discomfort. In so far as the process of digestion is concerned, the stomach is not an important organ. It acts primarily as a reservoir for food, prior to its entrance into the small intestines where most digestion occurs.