There's only so many ways to do the toy problems that people get assigned.
Students code winds up looking like their sources because they copy the control structures because there's only so many sane ways to do those problems without introducing fluff.
At least this is what my friend's experience using plagiarism checking tools was.
because there's only so many sane ways to do those problems
Indeed, that's been my experience too; if you assign something "Hello world" level, you're going to get a bunch of 100% correct solutions that look almost the same, and then the other... odd ones which are almost certainly incorrect in some way.
It's only when you assign something far more nontrivial, and with many correct ways to do it, that you will get more diverse solutions; and even then, the chances of the correct solutions being very similar are high.
Students code winds up looking like their sources because they copy the control structures because there's only so many sane ways to do those problems without introducing fluff.
At least this is what my friend's experience using plagiarism checking tools was.