Short answer: yes, you can get Drupal to associate captions to Media Library images.
Longer answer: there are at least two different angles to approach this from.
Approach #1: Media entities are fieldable just like any other entities, so you can add a Caption field to the Media entity itself.
Go to /admin/structure/media/manage/image/fields
and click "Add field" to add a caption for Media image entities.
Don't forget to adjust the Form display (/admin/structure/media/manage/image/form-display
) and the Display (/admin/structure/media/manage/image/display
) to your liking.
If necessary, you can set up different view modes with custom display settings, and you can override a Twig template to control the layout of the Media image entity.
Caveats to Approach #1: This approach means that the caption is bundled with the media image, so if you use the Media image entity on multiple pages, editing the caption will change the caption everywhere -- which is convenient if that is exactly what you want, but inconvenient if it causes unexpected side effects. It also means that the caption field may not be easily edited while editing the node that the Media image is used on.
Approach #2: One common workaround for these shortcomings is bundling the Media image entity reference field with a Caption field in a multi-field bundle using something like Paragraphs (other options include Field Collection or Entity Constructor Kit). This will allow users to edit the caption while editing the node that the Paragraph appears on. It also allows you to have a different caption each time the media image is used.
Caveats to Approach #2: This approach requires contributed modules; doing it in Drupal core is theoretically possible by creating a custom Content Type with the media entity reference field and the caption field, but the UX would not be quite as nice.
Approach #3: Finally, I should note that the two options can be combined. With savvy Twig conditionals, you can have your Paragraph template use the value provided in a "Caption Override" field in the Paragraph if it is available, or fall back on a global default caption provided by a field in the Media entity itself.