A sitemap is a discovery aid. It has no influence on ranking, and it cannot compensate for the problems that actually keep pages out of an index.
If a page is not indexed, a sitemap entry will not fix it when the page is thin or duplicative, when it carries a noindex directive, when it canonicalises to a different URL, when robots.txt blocks the path, or when it requires JavaScript that a crawler does not execute to render its content. In each of those cases the crawler found the page perfectly well and declined it. Adding it to a sitemap declares it more loudly to a crawler that already made its decision.
Small, well-linked sites often need no sitemap at all. If every page is reachable in two or three clicks from the homepage, ordinary crawling finds everything, and the sitemap is a formality. The sites where it genuinely changes outcomes are large ones, sites with deep archives, sites with weak internal linking, and new sites with almost no inbound links — the cases where discovery is the actual bottleneck.
The honest summary: a sitemap is a cheap, high-leverage fix when discovery is broken, and irrelevant when it is not. Checking that it resolves and declares roughly the right number of URLs takes seconds. Whether those URLs are worth indexing is a separate question, and a harder one.