Just to add my two cents to the discussion, a computer uses a pseudo random pattern generator called an Autonomous Linear Feedback Shift Register (or ALFSR for short) in software. What the ALFSR is is a series of 2-input XOR gates with flops between stages, in a pattern thus:
XOR-flop-XOR-flop-XOR-flop---(output back to one input of every XOR)
This structure represents a binary polynomial P(x)=aNx^N+aN-1 x^N-1+...+a1 x + 1, where the an's represent either a 1 or zero (either an XOR or a bypass) and N is the polynomial length. Assuming we've preloaded with a binary seed somewhere within the sequence, on a clock to the flops information will propage through and then the last bit back to all the flops. The net result is that you have what appears to be randomly distributed binary numbers off the flop outputs. This will cycle numbers up to a maximum of (2^N)-1 combinations. Zero is not allowed to be used as a random seed since it will always give zero output.
The polynomial selection is a science in and of itself, the goal of which is to have a full representation of all of the polynomial output. For example, P(x)=X^3+X+1 is unique and will produce a random combination of 3 bit numbers from 001 to 111, but in a pseudo-random order. There are larger order polynomials that are documented but I don't have that handy. Some polynomials are not full sequence and will not give all (2^N)-1 possible combinations.
This type of random number generation is useful in test pattern generation for digital chips. They use this polynomial and an inverse function called a compactor, and they drive random data through the chip as it's clocked. An expected pattern is known to be at the output of the test compactor that is compared to check if the digital chip has connectivity problems known as stuck-at faults typical of the manufacturing process. The ALFSR can either generate external patterns that are applied to the chip, or be embedded into the chip for BIST (built-in self test). Of course, there are unlimited software applications of random numbers but I'll leave that to the more software-oriented folks to discuss.
As for the random seed itself (i.e. the starting point of the ALFSR), I'm not aware of any processor instruction like rand() but conceivably it could be a number of things, from the system clock date/time to an antenna measuring random noise, provided that it's not zero. Also, if you know which pattern you want to start from in a test situation you can just choose that. But people already covered that in this thread.