For example, a magnifying-glass search button with no visible text needs aria-label=”Search” so a screen reader user knows what it does, since the icon alone conveys nothing to them. A related attribute, aria-labelledby, does the same job but references the ID of existing visible text elsewhere on the page instead of duplicating it.
ARIA labels should be used sparingly and only when genuinely needed; overriding an element’s accessible name with an aria-label that doesn’t match its visible text can actually create confusion for voice-control users trying to say what they see on screen.