The alt attribute has two jobs. For accessibility it's essential: users relying on screen readers depend on it to understand visual content, and it also displays when an image fails to load. For SEO, it gives crawlers text they can't otherwise extract from a picture, which helps pages appear in Google Images and adds relevant context to the page.
Good alt text describes the image accurately and concisely. Avoid keyword stuffing — "buy cheap running shoes best price shoes" is spam and hurts both accessibility and rankings. If an image is purely decorative, an empty alt attribute (alt="") is correct so screen readers skip it.
Alt text works alongside other on-page signals like descriptive file names and structured data. Together they make your visual content understandable to both people and machines.