Most of webmasters now are adding meta tags to their pages called OpenGraph
which holds the image,title,desc etc.
So when you type the URL facebook simply make a request to that URL and retrive the HTML and parse it to obtain the OG tags values and then displays it.
If there are not Open Graph tags it will make the same request but now it will parse the HTML in another way to obtain title,image,desc .. etc
For example it will read the title tag For the title and maybe the meta description for the description and the image their algorithm might select the biggest image or the first image it depends on them.
If there is no meta tags and title most likely it will parse the actual HTML content to obtain some info from it, for example it will take the <h1>
as the title and so on.
It's really not standard process it depends on their algorithms BUT for the OpenGraph meta tags
it's straight forward
I hope this can help :)