You can have it generate shitty code and then compare it against examples it finds online to iterate that code. Also, it was trained on the whole internet, including those good solutions, and can often reproduce them on its own. but you have to tell it, explicitly, to do all this to make better code, rather than just asking for the code.
Apple’s fate is to be the American Sony