Why can I create a bitcoin wallet offline and still have the public and private keys correspond?

Using the website bitaddress.org with my wifi turned off, I can create a bitcoin paper wallet. Did the specific wallet already exist before I "discovered" it? How do the public and private keys correspond? The website creates a random public key but how does it know how to create the correct private key?
2 answers 2