We don't "know" that. It depends on what data you're looking at. CDC has two papers supporting vaccine-induced immunity, one of which was highly flawed. And then there's the study from Israel clearly supporting natural immunity.
No vetting of that Israeli study, no peer review, no competent efforts to account for bias in the sample, and it just does not hold up to scrutiny when compared to other results.