Unsurprisingly, it's necessary to understand a problem to solve it - just like the proverbial infinite monkey would in theory produce the entire body of work of Shakespeare given enough time, in reality, only Shakespeare managed to write proper Shakespeare the first time out.
AI is the infinite monkey of coding. I, as a senior developer, have spend entirely too many hours of my working life fixing code written by monkeys, and I have already had to correct AI code (thankfully small and generated by a colleague who promptly apologized and decided to do his homework and study the problem at hand instead of winging it with Crapilot).