Web server (i.e. Apache, Nginx...) has possibility to catch requested URL and to convert them to something else, some other URL. Most common way is by using .htaccess file placed in site's root directory. In some systems files starting with dot (".") are hidden by default so you must enable somewhere something in order to see them at all.
It contains rules (among other things) how to recognize some routes or set of routes and what to do with them them.
I.e. you have "virtual" path like:
/event/32
You'll create a rule to catch every path that starts with "/event/" and also catch part after that ("32") and instead of opening un-existing directory it will call some script like:
/event.php?event_id=32
So that captured parameter has been sent as get parameter "event_id" to event.php script.
For this search/replace and capturing path part regular expressions are used.
You have many tutorials online how to do that, just google for them:
https://www.addedbytes.com/blog/url-rewriting-for-beginners
https://mediatemple.net/community/products/dv/204643270/using-htaccess-rewrite-rules
https://help.dreamhost.com/hc/en-us/articles/215747748-How-can-I-redirect-and-rewrite-my-URLs-with-an-htaccess-file-
....
Main server configuration is placed in some other server directory, most likely accessible only for server admin. But this .htaccess file a a way to allow "common users" to do some configuration changes, which will apply only for directory where that file is placed and it's children.
But you can also do a lot of other thins with .htaccess file, i.e. send some header parameters, allow/forbid access to some files/directories, set some simple login mechanism (password protection) and much more...