Psychiatric and mood disorders may play an important role in the development and persistence of irritable bowel syndrome (IBS). Previously, we hypothesized that stress-induced implicit memories may persist throughout life via epigenetic processes in the enteric nervous system (ENS), independent of the central nervous system (CNS). These epigenetic memories in the ENS may contribute to developing and perpetuating IBS. Here, we further elaborate on our earlier hypothesis. That is, during pregnancy, maternal prenatal stresses perturb the HPA axis and increase circulating cortisol levels, which can affect the maternal gut microbiota. Maternal cortisol can cross the placental barrier and increase cortisol-circulating levels in the fetus. This leads to dysregulation of the HPA axis, affecting the gut microbiota, microbial metabolites, and intestinal permeability in the fetus. Microbial metabolites, such as short-chain fatty acids (which also regulate the development of fetal ENS), can modulate a range of diseases by inducing epigenetic changes. These mentioned processes suggest that stress-related, implicit, long-term epigenetic memories may be programmed into the fetal ENS during pregnancy. Subsequently, this implicit epigenetic stress information from the fetal ENS could be conveyed to the CNS through the bidirectional microbiota-gut-brain axis (MGBA), leading to perturbed functional connectivity among various brain networks and the dysregulation of affective and pain processes.