This really depends because licensing is complicated. If you bought a laptop from an OEM and it had Win 10 on it then most likely it is using a digital license. A digital license is tied to the motherboard and so no license key is needed. The license cannot be moved to another machine as it is tied to the board itself. The notebook's recovery software (which is generally either on a hidden partition on the hard drive or available for download from the manufacturer) would restore the machine to its original OS using the digital license.
Once you're back to the original license you can upgrade like normal. Upgrading from Win 10 to Win 11 is free and the same license works. But that is only across editions (Home to Home for example). To jump to a different edition then yes you need a new license. Furthermore the digital license is no longer good enough and you'll need either the product key (given at purchase) or an MS account that has a license for the OS. If you have neither of these then you have to go buy a new license.
For example, my OEM system came with Win 10 Home installed. If I restore the OS (even with the Win 10 Pro media) then it defaults to the digital license associated with the board. I then upgrade to Win 10 Pro by associating my MS account that has licenses for Win 10 Pro and the OS upgrades. Alternatively I could have entered a product key and upgraded as well. If I ever wipe the machine and run the Win installer again then it'll revert to the Win 10 Home license and I have to repeat the process.