The alt attribute provides an “alternative description” for the image. This description is normally not presented to the user, but will be under certain circumstances:
Assistive technology — If the user is visually impaired, and is using a screen reader, the screen reader will read the alt description to the user.
Images turned off — Some users prefer to surf the web with images turned off (to save bandwidth or to minimize distraction). These users will normally see the alt description instead of the image.
Image failure — If an image fails to load for any reason (bad file name, connection problems), the user will usually see the alt description in place of the image.
Here’s an example of displaying the alt text in place of a failed image (the image src points to nothing).
<img src="not-a-real-file-name.jpg" alt="Depending on your browser, you might see this message in place of the failed image.">