@BldrDad I agree with the latter and that many students resort to plagiarism because they are in a bind, whether over their head or in a time crunch.
I disagree on the collaboration being inadvertent because the rules for CS-50 are well-defined. For example, another student can look at your code to help debug but you can’t look at another students as reference. And while it doesn’t say this explicitly, don’t use google to find the answer. If you do find the answer, you likely just broke the rules.