The "a" and "b" variables ae the semi-axes for the super ellipse, "n" is the power term (with the famous "squircle" using n=4), "segments" is how many Bézier curves we want to use to approximate a quadrant of the superellipse, and "opacity" shows or hides all the points we're generating alone the way.
We're doing this is three steps: first, we know that ellipses are symmetrical and that if we can model a quarter of one, we have the whole thing (by mirroring and rotating) so we just need to figure out how to approximate a quarter of the ellipse.
we do that by first figuring out for how long the quarter curve is "straight, ish", and we approximate those sections with a barely curved Bézier curve at the start and end. That leaves a much smaller curve we need to properly approximate.
But Bézier curves are rather nice in that if you need to create a sequence of them that all join up, you can very quickly calculate how to do that: we need to ensure that the tangents line up, which I've drawn in mustardy yellow here, and then we can create a Bézier curve that passes through the quarter superellipse's "mid point" by exploiting a nifty property of Bézier curves.
With that, we've approximated a quarter superellipse using only three Bézier curves. Neat!