Some time ago in a universe far far away, Sun tried using native APIs to render Swing widgets to “look” native. So on Windows, they used Windows APIs to paint buttons, comboboxes, scrollbars, etc. Under GTK they used GTK APIs. See
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java for the native bindings, and elsewhere in the same package for how they are used in the UI delegates.
That was pretty awful though. You can maybe get 75-80% there in terms of base rendering, but it quickly falls apart at the “seams” where you have mismatch between the APIs your widget supports (in terms of visual state, layout, etc) and what the native APIs support. For me, the worst thing in the “native” Windows look-and-feel at that time were animations. There’s really only so much you can recreate with these native APIs when your UI components are very much not native.
The macOS theme I linked above was emulation instead of calling native APIs. That can also get you so far, and you’d need to try and catch up with changes in the underlying OS changes every year.