Sometimes an epigastric hernia happens when a baby is developing in the womb. This can happen when the tissue and muscles in the baby's abdomen do not close completely during development.