Of course, everyone builds on the work of others. The problem with plagiarism is that an author builds on the work of others without citing.
However, with computers and the data we have, I think we are pretty close to the point where a computer program could quickly do similarity searches and automatically generate all the citations.
A lot of this technology already exists with plagiarism detectors which can detect uncited sources. We just have to make it add those sources as citation.
It could kind of be like auto format for scientific papers. The analogy would be like instead of getting into a discussion about formatting and tabs vs spaces on every pull request, we just have an auto format that runs for every pull request, and removes that contention
We might be able to do the same with citations and make plagiarism a thing of the past.