In the void setup() function, you set your fading LED as an OUTPUT with pinMode(). Remember than analogWrite() (the function that will fade the LED) only works on pins 3,5,6,9,10,11 on the Mini Carrier board.
The void loop() contains only two for loops. The first for loop creates a brightness variable with a value of 0. As long as that variable is less than 256, the code between the curly braces of the for loop will run and brightness will be increased by one with the brightness++ command. Remember that brightness++ is the same thing as brightness = brightness + 1.
Inside the for loop, the analogWrite() function writes the value of the brightness variable to pin 5. During the first repetition of the for loop, the brightness is 0. During the second repetition of the for loop, the brightness is 1. By only delaying 5 milliseconds, the fade will look very smooth.
Once the first for loop has run 255 times, it is complete and the computer will look to the next line of code. In this program, it's another for loop.
This for loop creates a new variable called brightness. No matter where the last for loop ended, this for loop will start at 255. For example, if the last for loop ended with brightness of 10, this second for loop would still start with a brightness of 255. These variables have the same name, but they are not the same variable. You can change the name of brightness to any other name and the code will still run.
In the second for loop, the for loop will continue as long as brightness is greater than or equal to 0. Each time the for loop runs, it subtracts 1 from the value of the brightness variable. After this for loop has run 255 times, the brightness of the LED is back to 0.
Now the void loop() starts again, running the first for loop 255 times, then the second for loop 255 times.
This program matches up the names and values of the variables for a smooth look, but you could also mismatch the values of the variables so that the light fades up to half-brightness, then fades down from full brightness - it's all in the controls of the for loop.