From :focus-visible MDN docs:
The :focus-visible pseudo-class applies while an element matches the :focus pseudo-class and the UA determines via heuristics that the focus should be made evident on the element. (Many browsers show a “focus ring” by default in this case.)
See also:
- Keyboard-Only Focus Styles
:focus-visible and backwards compatibility