A sitemap helps discovery. It does not get pages indexed. Those are separate stages, and a sitemap only touches the first one, which is the cleanest way to settle the either/or in the question.
Discovery is Google learning that a URL exists. A sitemap is a list you hand over saying these pages are here, which genuinely helps Google find URLs it might otherwise miss, especially on a large site where not everything is well linked, a new site with few external links pointing in, or a page buried deep in the structure. For finding pages, the sitemap earns its keep.
Indexing is the separate decision that comes after: Google crawls the discovered URL, evaluates it, and chooses whether it is worth a place in the index. The sitemap has no vote here, and Google says so directly. Its documentation is explicit that a sitemap only helps Google find URLs and never promises those URLs will be crawled or indexed. Search Console makes the same point, that a URL appearing in a sitemap carries no guarantee of ever being crawled or indexed at all. Listing a page is an introduction, not an endorsement.
This is why the common promise, add the page to your sitemap and it will index, is wrong in a way that wastes time. When a page is stuck unindexed and already in the sitemap, resubmitting the sitemap changes nothing, because discovery was never the blocker. Google has found the page and declined to index it, and that is a quality judgment the sitemap cannot influence.
So treat the sitemap as exactly what it is, a discovery aid that makes sure Google knows your pages exist, and a useful one. Just never read its presence as a reason a page should be indexed. If a discovered page is not getting in, the work is on the page, not on the list it appears in.