Apple Pencil is a Bluetooth device and is not tied to the iPad its paired with any more so than Bluetooth headphones are.
Per Apple:
After you pair your Apple Pencil, it will stay paired until you restart your iPad, turn on airplane mode, or pair with another iPad Pro.
You can also manually make your iPad forget the Bluetooth association (go to Settings > Bluetooth > tap the "i" button across from Apple Pencil > tap Forget) but that doesn't affect the Pencil in any way other than you'd need to re-pair to use it again.
Answer from tubedogg on Stack Exchangeipad - Reset used Apple Pencil in preparation for sale? - Ask Different
Apple Pencil 2 not used in a long time. i… - Apple Community
Should I buy a 2nd gen Apple Pencil from Apple or eBay
For sale: Unused Apple Pencil (2nd gen) - Apple Community
Videos
Hello, I've recently bought an M1 iPad Pro and been looking for a new apple pencil as I'm upgrading from a 9th gen base iPad with the 1st gen Apple Pencil which will obviously not work with my new iPad. However, I discovered that Apple stills sells them for £129 on their website, despite already having the Apple Pencil Pro out for the same price (at least in the UK), whilst eBay sellers are listing them for about £60 - £70. Do you think I should take the risk and buy it off of eBay or should I get it straight from the source. Thanks.
If anyone has been considering buying the 2nd gen Apple Pencil recently, this would be a great time to buy it. Currently on Amazon, the pencil is on sale for $80 new but if you look at the used option, it’s a like new from warehouse for $59. Usually looks basically brand new and condition states that it is the case for this one. The box should also be included.
https://www.amazon.com/Apple-MU8F2AM-A-Pencil-Generation/dp/B07K1WWBJK/