LLMs ingested a lot of high-quality code during their training, plus LLMs being capable of programming is a huge commercial use case, so no wonder that they are good at coding.
My experience, though, is that they aren't good at defining the task to be coded, or thinking about some unexpected side-effects. Code that will be left for them to develop freely will likely become bloated quite fast.