LLMs use abstractions a ton in code though: standard library functions, popular libraries, etc. They just dont always make their own abstractions. At least not particularly good ones. LLMs work really well when they have well abstracted pieces to put together.
With good source code they output good code that mimics existing code.
If they don't have good code to mimic, anything goes. They might use libraries or they might start to write their own implementation of a PNG encoder.