A Mac or PC can use the iPad as a second display - but iPad cannot extend its own display to a Mac or PC.
In more detail...
iPad is not currently capable of offering an “extended desktop” experience - such as that to which you may be accustomed on other computing platforms. The Mac Sidecar feature provides limited scope to use iPad as Second screen from Mac - but not the other way around.
Your iPad can drive an external display using AirPlay - or via HDMI (and appropriate adapter where needed) - but neither can re-scale the iPad output to match the native resolution of an attached monitor.
There are some iPad Apps in the App Store that provide some external connectivity options for PC and Mac (such as Duet and Duet Pro). These can be expensive - and have mixed reviews.
Here is a third-party comparison of some of the options - including a detailed look at SideCar.
https://thesweetsetup.com/apps/best-app-for-using-an-ipad-as-an-external-display/