Because the API is operating system-specific, it differs from operating system to operating system.
However, irrespective of the operating system, the API allows the application to get the job done without knowing how the operating system does it.
It serves to mask the differences between different hardware by presenting a common interface to the operating system.
To most people, whenever they command the computer to do something, it just does it.
The operating system never communicates directly with the hardware.
It can only communicate with the operating system through the API or Application Program Interface.
The API is a set of common functions that the application calls upon to get the operating system to do what it wants.
Let's visualize the computer system as three separate layers that communicate with each other through different interfaces.
Each piece of hardware comes with its own BIOS and/or driver, which become part of the system's BIOS.Therefore, the BIOS layer is dynamic and changes to match the computer's hardware configuration.