Anyhow a very basic explanation; the public key is generated from the private key, which in turn is generated by just taking a large random number. - https://en.bitcoin.it/wiki/Private_key
The private key comes into play again when you're trying to spend from said adress- to prove that you "own" the public key that was generated from it, and thus the adress.