There are often many ways to deploy code to production, the "main" branch being the common path. Poorly configured CI credentials that allow off-main deployment is often possible. My favorite is cross-branch build cache poisoning.
It could be as simple as no branch protection, but it could be vastly more complicated.
> gained access to our CI/CD system. ... CI/CD contains infrastructure related secrets in order for our product to work.
I'm guessing poorly secured CI pipelines/security tokens. Not a good look, but unlikely the front door was left wide open.
Unfortunately there are a lot of footguns in CI/CD systems.