Sitemaps are text files ideally listing all pages (absolute URLs) under a certain domain to simplify the crawling by getting all available URLs provided and to index it properly.

What is a sitemap?

A sitemap is (usually an XML) file with information about the pages, videos, and other files on the site. 
Search engines use the sitemaps in order to crawl the site correctly, as it communicates to the crawler the following information:
identify the essential files on the site
crawl the latest page and content updates
See the alternate language versions of a page
Specify the video running time, category, and its age appropriateness rating
View the images' subject matter, type, and license.

Why do you need a sitemap?

A sitemap helps the crawlers discover the website and its pages and improve the site indexing. It is recommended to submit an updated sitemap if:
The website is really large, and the sitemap will help crawlers find the newly added or updated pages.
The website has a lot of content and page, but they are not linked to each other.
The website is newly published and has few external links to it. If there are no links pointing to the newly published pages or site, Googlebot and other web crawlers might not discover them.

How to build a sitemap

Once the pages to be crawled by search engines' crawlers are selected, determine the canonical version of each page and the sitemap format to use (XML, RSS, mRSS, and Atom 1.0, Text). 
The sitemap can be manually created or automatically generated from several third-party tools. After the sitemap is generated, make it available to the search engines' crawlers by adding it to the site's robots.txt file or by submitting it to Search Console.