Optimization is not the same as security. The first iPhone was jail broken and unlocked within days of its release IIRC. As the years went on, we were lucky to get a jailbreak at all. In fact, checkra1n was the newest exploit in a long time. Yes, their quality has gone down a bit, but don’t confuse that with their security measures.
No, but QA is necessary for security. If they're letting through bugs that cause crashes or product misbehaviour, then they're also more likely to be letting through security issues.
Apple effectively put an end to the jailbreak scene by allowing people to compile their own applications without paying a dime. Put the incentive away and suddenly there's a lot less eyes on the code.