How does windowing system work on MacOS? I'm really interested in computer graphics and I would like to know how windowing and graphics systems work on MacOS.
I've started to learn how to create a window in objective-c but then I told myself that it doesn't explain what does objective-c "ask" to the hardware exactly. So I've read about X11 but I still had to install another program 'XQuartz'.

Do you have any suggestions to learn how to create a window from scratch without using any framework or library on MacOS, if it is even possible? And if it's not possible on MacOS, do you know what makes it impossible (or complicated) on MacOS?
Macs have their own windowing system called AppKit which is not based on X11. You can certainly install X11 and use it but it's not how most Mac apps work. Creating a window from the ground up with no frameworks is going to take some work, and is maybe better suited for Stack Overflow. Even there though, this is such a rare need that you might have trouble getting an answer.

If you want to get into the real low-level details of making things work, resources exist, though you can no doubt Google as well as me. One good starting point might be the New OSX Book site.

A simple example with minimal framework code might look like this:

import Foundation
import AppKit

let aWindow = NSWindow(
    contentRect: NSMakeRect(0, 0, 400, 210), 
    styleMask: [.titled, .closable], 
    backing: .buffered, 
    defer: false)
aWindow.makeKeyAndOrderFront(nil)

RunLoop.current.run()