How does Safari recognize which URL it has to open

For example I have Safari chosen as default browser on a system (e. g. macOS Big Sur) and I open Notes and type a link https://apple.com. Then Safari window pops up with new tab that loads content of web page with requested URL. My question is: how Safari knows URL it should open? Whether it is pass as argument to executable? Or there is some different mechanism?

How does Safari recognize which URL it has to open
 
 
Q