opacity dims a whole element uniformly, but mask-image: linear-gradient(...) uses the gradient's brightness as an alpha channel, erasing only part of it — near-white stays visible, near-black disappears.
Common for horizontal scroll carousels, long tag lists, or content that should fade out naturally as it scrolls under a header.
When to use
Use to soften the end of a list naturally. Some browsers still require the -webkit- prefix for mask-image.