There are two kinds of plagiarism, ordinary and "self". It is pretty much impossible to plagiarize unintentionally. It is an intentional act. Let me explain.
Ordinary plagiarism has two aspects. One is knowingly attributing the work of others to yourself. We avoid it by citing the work we use, giving credit to the originator of ideas that we depend on. But you have to know that the work belongs to another in order to be at fault here. Independently reinventing something yourself isn't plagiarism, though it may appear so. You may still be at fault if you don't know something that you should have known, but the fault isn't plagiarism. Something more like laziness. But intentionally appropriating the ideas of others is seen as an act of malice.
Again, reinvention isn't plagiarism. If I, as a kid, rediscover the Pythagorean Theorem without the help of books or teachers, or anything, just starting with the idea of a triangle, it is reinvention. It isn't plagiarism. It isn't likely publishable, of course, and if I try, people will laugh.
The other aspect of ordinary plagiarism is that we cite the work we use so that readers can trace ideas back to their source, finding complete context for the ideas, their origin and use along the way. The papers that originated the idea have a context, including the papers they cite, and it is sometimes necessary to go back and examine that. If you don't cite, you break the chain.
Self plagiarism is when you use your own previously published work without citing it. Only the second aspect, above, applies here, but it is no less important. Don't just copy-paste (or even paraphrase) from your own old (published) work without citation. But some people do this out of laziness, rather than malice.
But, aside from the technical details, a scholar will spend a fair amount of time researching what is known already about things they wish to explore. This gives the advantage of being able to catapult off of the earlier work (citing it) and deepening your knowledge. It also, hopefully, shows you what is yet to be done in a field, so that you can direct your efforts in meaningful ways.
But ignoring the literature is normally a fault if you wish to publish. People expect you to know the field to the point at which your own explorations begin. If you don't, then your papers will likely get rejected and charges of plagiarism might be made, even if incorrectly. But that is carelessness masquerading as plagiarism, not plagiarism.
As I said in a comment to another post, you don't need to cite things that are "common knowledge". This is a bit hard to define, but generally things taught in, for example, secondary school are common knowledge, though not universal knowledge. But, if in doubt, citing is safer than making assumptions.
Do your homework reading the literature, and, then, cite it if you use it.