rand() doesn't generate random numbers. It generates PSEUDO-random numbers. Computers are not actually able to generate real random numbers, they can only generate sequences of values that seem random. Quality of this pseudo-randomness depends on the algorithm used. rand() uses very simple algorithm thus it is fast, but generates a poor quality sequence where dependencies between elements of the sequence can be easily found. Nevertheless, for many cases (like simple games, or whatever a beginner could make) it is sufficient. It is not sufficient for example in cryptography, where it is critical to have the highest possible quality of a pseudo-random sequence.
As for your second question, in C++ NULL is defined to 0, so go figure the difference.