A hernia occurs when an internal organ or tissue protrudes through a weak spot in the muscle or surrounding tissue wall, often causing pain and discomfort. It is commonly treated through surgical intervention to repair the defect and prevent complications such as strangulation of the protruded organ.