For anyone who wants to know the difference between Sidecar and Universal Control, allow me to explain in this post. (Feel free to correct me if I'm wrong on anything.)
Both of these features of macOS can be of potential use to Keyboard Maestro. These two terms represent two concepts with very different results, but they are both accessed through the same pane in System Settings, so it can be confusing. (Not only that, I find the interface to be a little buggy, where I sometimes have to set things up twice before it works.)
Sidecar is intended for making an iPad into an external monitor, (either mirrored or extended, or even as the Main Display) causing iPadOS to essentially disappear. Here is a screenshot showing how to configure an iPad in this manner:
One of the downsides of Sidecar is that it will often lower the resolution of the main display into a low resolution display. This is necessary in order to make both images look good.
Universal Control is different: (almost the opposite) it allows your Mac to control your iPad's OS using your Mac's keyboard and mouse. In this case, iPadOS continues to function and you can use your mouse and keyboard to control it. Here is a screenshot showing how to configure an iPad in this manner: (notice the words "Linked Keyboard and Mouse".)
Both of these are quite amazing. The only thing that I find very disappointing is that under Universal Control, you can't use your finger on your iPad as a way to click the mouse. I was so disappointed when I first learned this. However today I noticed that there's a feature called "Enable Double Tap on Apple Pencil" (which you can get to from the System Settings pane if you click on the iPad at the top) which works if you have an Apple Pencil for your iPad. Moreover, despite the name, it doesn't just enable double taps, it also enables single taps and click/drag. This is new to me! I have to try it out right away. If I had known about this new feature I would have worked on it a long time ago.
The only downside (which I haven't actually tested yet) is that it probably requires a Wifi connection to your Mac. I suppose that's understandable, but I'm hoping it will work over internet connections also, so that I can use it when I'm in a restaurant away from home.
Using this feature I'm able to open the Keyboard Maestro editor on an iPad with my Apple Pencil, edit macros, and run them (interacting with them using the Apple Pencil.) And the result can be the macro's output being displayed on my iPad. This opens up some new possibilities.