How do you know that those "leaks" were not by Apple for PR? It is all a PR game; it gets more publicity than any other means.
> Why do you think software leaks are so uncommon, even with massive teams? Is it tighter security, company loyalty, high pay, or something else?
It is not uncommon. Sometime back a hedge fund took one of its former employees to court due to code theft.
The reason most employees don't do that because the code base of tech companies is huge and most of them use proprietary tools.
And even if an employee steals the code, it will not be used by competitors because hiring engineers is cheaper than hiring lawyers. Sometime back a disgruntled Intel employee, when leaving the company to join AMD, stole some documents of the project he was working on. After joining AMD, to impress his new employer(who is a competitor of his previous employer), tried to give them the stolen documents. Not only did he lose his job at AMD, but AMD informed Intel about the theft. The guy was arrested.