@aemUser2345 On a high level , the URL is decomposed into individual parts and based on that a mapping to a resource in the JAVA content repository is done.
For a detailed look at this url resolution, check out the below links :
https://sling.apache.org/documentation/the-sling-engine/url-decomposit...