That code sets the low bit in the output accumulator iff the intensity is higher than the current position in the pulse width. (The total pulse frequency is 256 steps of i wide. The bit is on for intensity_of_led amount of that total time.)
The output accumulator is then left shifted by 1 bit each time, so in the end, the accumulator ("output") contains the values for ABCDEFGH in bits 7 through 0.
Shift out that output value and strobe the shift register and it presents bits ABCDEFGH in outputs ABCDEFGH.
Then, wait the needed amount of time and go do the next cycle of i.
On the bench, you can drive small LEDs right off the 74HC595 (though note that you might not be able to drive all LEDs 100% on without exceeding the max current on Vcc pin, so if you're going to breadboard it, only use 2 or 3 LEDs while you're first testing [where you're likely to test with "all on"]). Later, you can implement the Night Rider pattern directly on the 595, and even later drive MOSFETs off the 595 outputs (when you want to drive bigger LED loads).
If the code doesn't work or you get stuck, let me know and I can put it into Arduino studio and see what I did wrong.