It's not clear what you mean when you say "on their own". It wasn't like the LLM was idle and randomly decided to start hacking. At least for the OpenAI one, it was being tested and given a task, and it determined that part of accomplishing that task was hacking another server. It was supposed to be isolated in a secure "sandbox" not connected to the internet, but found a vulnerability in some software running in the sandbox and broke out.
Edit: I should add that there are credible accusations that these companies are intentionally making it possible to break out of their test environments for publicity.