The several stops are what make it progressive. A two-color gradient gives a hard linear fade. The extra steps ease the content out gradually, so the top edge feels soft instead of cut.
Result:
height is how far down the fade reaches in logical pixels. Raise it for a longer fade, lower it for a tighter one. The mask is alpha-only, so it works the same in light and dark mode.