Okay, so 'tablet' has a dual meaning these days, which is partly why I think you're so confused.
There are tablet devices, such as iPads, Samsung Galaxy Tabs, and the Wacom MobileStudio. These run iPadOS, Android, or Windows, respectively. You don't plug these into a computer. They're self-contained devices.
There are also drawing tablets. There are peripheral devices, meaning you have to plug them into an existing computer. There are two main kinds - the kind without a screen (meaning you see your drawing on your laptop screen, while using the tablet works a bit like a pen-shaped mouse) and the kind with a screen (which you draw on directly, but still needs to be plugged into a computer.)
So, now that we have that distinction out of the way, to answer your question:
Most drawing tablets will work with any PC or Mac drawing software. If your computer can run it, the tablet will work with it.
However, this is not the case with tablet devices, other than the Wacom MobileStudio. (Which is a crazy price, so it doesn't really bear mentioning.) Tablet devices don't run Windows, so they're limited to what's available in their app stores. iPads have Clip Studio Paint, Procreate, and a number of others. Android-based tablets, like those from Samsung, are much more limited in high quality art programs, as well as having poorer pen accuracy; I wouldn't recommend getting an Android tablet.
Also do not get a Microsoft Surface Pro. Been there, done that, lost a good two years of artistic progression struggling with that thing. It has terrible pen accuracy, and it's a laggy, slow device after only a few months of use.
Personally, I use an iPad Pro with an Apple Pencil, and a drawing app called Procreate. I adore this setup. It's powerful, portable, and I can create large volumes of nice-looking art with it. If you're after a recommendation, that's mine.
I've also used Macs and PC's with Wacom Graphire and Wacom Cintiq tablets, all of which worked wonderfully. (Graphire tablets aren't a thing anymore, but Bamboo and Intuos are good equivalents.) I mostly used Photoshop and Clip Studio Paint back then. I preferred the Cintiq tablets, I find it nicer to draw directly onto a screen, but they're also extremely expensive - I did fine with the Graphire for years as a beginner.
I hope that clears a few things up!