On the right there is a dark area and a light area, the gap filled by a luminance ramp. The luminance ramp goes up, and then stays constant (visible in the green profile). The visual impression, however, is a bright band a the right end of the ramp, and a darkish band a the left end of the ramp (the latter being less pronounced).
The sliders allow to control the width of the ramp and the luminance contrast. I find it surprising how shallow the ramp can be with the Mach Band remaining visible.
Mach Bands are old hat: 1865, also they’re weak, but interesting all the same. In brief: Mach Bands appear at points of inflection in a luminance (or colour) gradient. The figure on the right (modified from Mach 1920, X, 11, Fig. 27) shows a pattern which is to be rapidly moved (in a repeat pattern affixed to a drum) so fast, that the white and black mix to form a gradient: The gradient starts light on top (A), slowly getting darker, at the inflection point α getting darker faster, at the second inflection point β getting darker more slowly again. My demo above differs in that it is rotated by 90° and the shallow outer gradients are simply on level luminance.
Mach Bands are (nearly) not related to the Hermann Grid. Their explanation is classically linked to processing of the visual input in the retina (e.g. lateral inhibition). That is not really wrong, but the details are markedly more involved, see Wallis & Georgeson for a current in-depth account.
Mach E (1865) Über die Wirkung der räumlichen Verteilung des Lichtreizes auf die Netzhaut [On the effect of the spatial distribution of the light stimulus on the retina]. Sitzungsberichte der mathematischnaturwissenschaftlichen Classe der kaiserlichen Akademie der Wissenschaften 52:303–322
That source is not easily accessible. Find Mach’s own summary here (a page from the fabulous Leipzig Wundt collection) in sectionX- 11. He even displays the second derivative formula, which corresponds to the points of inflection I mentioned above.
Mach E (1886, 1920) Die Analyse der Empfindungen und das Verhältnis des Physischen zum Psychischen, 9. Aufl. 1922).
Wallis SA, Georgeson MA (2012) Mach bands and multiscale models of spatial vision: The role of first, second, and third derivative operators in encoding bars and edges. Journal of Vision (2012) 12(13):18, 1–25