The feature you’re referring to, (Open Graph), is a set of metadata tags defined by the Open Graph protocol (namespace https://ogp.me/ns# ).

in HTML <head> :

<meta property="og:title" content="Example Page" /> <meta property="og:type" content="website" /> <meta property="og:image" content="https://example.com/cover.jpg" /> <meta property="og:url" content="https://example.com/page.html" /> <meta property="og:description" content="An example page for Open Graph." /> Without Open Graph tags, social platforms may guess the title, image, and description, often incorrectly. With og: tags, you control exactly how your page appears when shared.