rand is a function that returns a number between 0 and at least 32767. The exact range is from 0 to whatever the macro RAND_MAX is defined to be.
rand is often used with the % operator to put a limit on how many kinds of values it can return. For example, rand() % 8 would return a random value 0 through 7. Similarly, you can write rand() % 12 + 1 to return a random value 1 through 12.
However, if your just call rand without seeding it first, it will always return the same values each time to run it. To seed it, you call srandonce at the top of your program and pass it some value that you'd like rand to use. If you use the same values in srand, then rand will return the same results. Therefore, srand is often called like so: srand(time(NULL)); for the simple reason that the value of time(NULL) changes each time it's called, thus changing what rand returns each time.