What is the purpose of the ‘alt’ attribute in images?

The alt attribute provides alternative text if an image fails to load and improves accessibility by describing the image content to screen readers.