Sitemap is an exhaustive list of all the web pages on your website to help search engines crawl all your web pages.
When a search engine bot crawls your site, it looks at the sitemap and crawls urls mentioned in your sitemap.
If you don't provide a sitemap, then the search bot has to start crawling from your home page, or online backlinks to your website. When a search bot crawls your home page, it will also crawl the outbound links on it, and then continue to recursively crawl those pages too. However, in this case, it's possible that many of your web pages remain uncrawled and non-indexed simply because they are not reachable (linked to) from your home page.
That's why you should create a sitemap and upload it to google search console so that google knows where to find all the web pages on your website.