Whatever Windows came preinstalled, HP must have put a sticker at the bottom of your laptop. If it's Windows 7, the key on the sticker can be used to download the right installation media from Microsoft.
If you want to use Windows 10, you can simply download the installation media without using a key as your hardware has been registered by Microsoft. Your hardware is your activation key, meaning that you can install Windows 10 without entering a key. If the motherboard, and possibly the CPU, is replaced then your activation key becomes invalid and you have to phone Microsoft for activation. Microsoft will only grand this if you had to replace the motherboard due to a malfunction.
Regarding Windows 7, in the motherboard the BIOS has a...