Does it create a public key based of private?
Yes, a cryptographic routine exists that computes the public key from the private key.
maybe on the wallet.dat file?
All modern wallet software generates keys derministically from some sort of master key, or seed phrase. That master key is stored in the wallet, and all other private keys are derived from it, ...