For school writing, it's more difficult to know, because the subject matter is so well trodden and students writing stuff they didn't really want to write trying to "impress" a teacher with wordiness and crap has a lot of the same vibe of GenAI writing. It's mostly obvious when there is a stark style/knowledge inconsistency with your personal knowledge of the student. Personal knowledge of a student is non-existent in lecture hall sized freshman level courses.
For code, well, at least the most problematic submissions are pretty blatanty obvious. They are obviously the result of a person asking for something nonsensical and the GenAI outputs content as consistent as possible with the stupid request, and a stupid request manifests in a very glaring way.
Sometimes it isn't the initial submission, but the resulting dialog that betrays it. Someone submits a small patch that is... well... short and to the point but the change doesn't seem to match the reported scenario it tries to address. In pursuit of clarification it becomes pretty obvious that the problem lacked sufficient actionable info, but the GenAI operator pushed it to produce something and out came something with a rationalization that sounds plausible but isn't anything.
Also the write up, of issues and code contributions. Humans are inclined to just make things to the point. GenAI sloperators make dissertations out of stupid simple things, with all sorts of tedious styling and crap. Frustrating because somewhere in the mess is their point, but it's buried beyond recognition.