Do all windows based programs use the windows API? How are programs made without it?
===

I've been programming for a few years, and I know how to create my own complex methods using pre-existing/standard libraries. I was always wondering (Java for example) how is a JFrame created when creating a JFrame object in Java? How do you use standard code (no libraries) to code a GUI or complex operations like creating files, reading files, etc.

If all these existing methods we use can be compared to building blocks we use to build a pyramid. How are these blocks created in the first place? (I mean technically). A programming language without standard libraries is variables, loops, and math (and even the math functions were created by someone).

The basic question is Does Java or C or any other language (while operating on Windows for example) complete all its operations by calling Windows .dll libraries for creating windows and other complex operations? 

If so, How were these complex operations/methods/functions created in an operating system with just regular variables, loops, etc.

There's a gap in my understanding of programming.
I understand computers read binary (electricity = on/off), someone made assembly/assembler to convert binary to more readable code which moves numbers from different registers in a processor, which can lead to basic math, addition, subtraction, multiplication, divison. The gap in my understanding is the jump from Assembly to a higher language like C that holds variables, does loops, creates GUIS, Operating systems.