Having AI write the homework/report/paper is considered plagiarism. It’s really easy to profs to check it because people who do it usually don’t even bother reading their own slop. It’s obvious nonsense and they can’t answer a basic question about their own work.
With coding it’s obviously harder, but the same works - asking “what does this part of code do” is very effective.
With the last part the real problem is lazy profs. Most don’t want to be bothered with ever talking to students, checking assignments, tutoring. If they could some of them would only do final exams.