I actually didn't like Cocaine Nights that much when I read it, as though it was a fun enough read, I felt it was another reworking through of a recurring obsession for him. As for it's roots - to get all amateur psychoanalyst for a moment, I'd suspect his ideas about human nature are hugely shaped by his childhood experiences in Shanghai. He dramatises a lot of this is Empire of the Sun, which is an amazing read. It details a time when the superstructure of society had completely fallen away for a while, and all that is left to do is scrabblearound in the ruins. Apparently, he was living wild for a while and then was interned in a POW camp with his parents. God only knows what the dislocation must've been like coming back to England after that. And being sent to public school!
There's a quote from him I can't quite remember - it goes something like "if you've lived through a period of complete social breakdown you view basic human nature very differently". I've completely mangled that but hopefully you get the gist. This sense of breakdown, implict violence, this was his experience at a formative time which is why it reoccurs so much for him. It's also where a lot of his personal iconography comes from - empty swimming pools and downed aircraft.
Another interesting interpretation re. EoftheSun and Ballard's writing in general - I found it written in a very detailed way, but almost affectless - the protagonist doesn't really experience emotion, distress etc. It's very curious, and a noticeable stylistic tic with Ballard. I wonder to what degree this is connected with the painfulness of his experiences?