Evening Tyler, welcome to the forum. For future post I recommend using the preformatted text button (the one shaped like </>) for sharing code. Makes it a bit easier for us to copy-paste and play around with it
If I understand your code correctly, int index is the array number (0 - 19), and countArray[x] counts how often that index has been randomly ‘rolled’. You start out with a completely empty array with 20 slots, but each time your sketch goes through draw it adds +1 to one of these 20 slots. How often each slot is rolled is visually shown through graphs because of this line:
rect(x * w, height - randomCount[x], w - 1, randomCount[x]);
it picks the bottom of the screen (height) and subtracts the amount of times that array slot is rolled (-randomCount[x]). The utmost left slot for instance, which is randomCount, will often remain 0 for a longer time than the other slots.
Does that clear things up for you?