This cart is a made up of lot of lines of different lengths moving at different speeds (and wrapping back around to the left). The colour for each line is either 1 (the water colour), or the moon colour selected from the top of the screen.
srnd() seeds the random number generator on every frame, and this is used to get a set of random, but consistent, values each frame for each of the lines, their speeds, etc. It’s much easier and faster to do this than to e.g. generate all those values once and then store them in a table or an array.
Pictures
This is a slowed-down version showing how each frame is rendered.
This shows the midpoint and colour for each line (the effect with the width of each line being 0).
You can see how precise the reflection of the moon looks here. It just gets all jagged in the full effect because each pixel's colour is used for a whole line.