Endoscopy is particularly useful in cases of ingestion of caustic substances such as acids or alkalis. These substances can cause severe damage to the digestive tract, and endoscopy helps in assessing the severity of damage. It allows the physician to identify the extent and depth of tissue injury, which is crucial for determining the appropriate management and prognosis.