A caption is a brief description accompanying an illustration. You know the online photo of your baby cousin face-planting into a cake? The description underneath it that says "Hugh's First Birthday" — that's the caption.
The Latin root of caption is capito, which means "seizing" or "holding." What do captions have to do with seizing? Nothing. Centuries ago, when authorities seized someone's property for legal reasons, they presented documents that began with the phrase "certificate of caption." Eventually people began using the word to refer to the beginning of any document. Then they began using it to mean any article or chapter heading. And from chapter headings it was a short hop to picture headings. A long journey for a word whose definition includes the description "brief"!