Just confirming
POSIX specifies the API available to programs, and also shell and commands and stuff available to users. It does not specify which functions should be available from the standard C library, and which should be available from the kernel: from the standpoint of POSIX, it’s all the same. POSIX doesn’t care how the API is implemented, just that it is implemented correctly.
It’s more or less a standard that describes how UNIX compatible OSes are supposed to work. That includes the APIs/ABIs as well.
At least that is how I understand it.
its a way for scripts or program to be portable and compatible.
POSIX is a standard, or rather a whole series of standards. It also covers things like the shell and shell utilities, and the semantics of various kernel services, as well as the C libraries. These days you might want to look up SUS (Single Unix Specification) too.
https://en.wikipedia.org/wiki/Single_UNIX_Specification
https://en.wikipedia.org/wiki/POSIX