It emerges from the lawsuit, which was filed by Tesla in March this year. The person in question, Guangzhi Cao, admits that he gained access to the source code and uploaded it to a private iCloud account in the form of zip files. Cao was one of around 40 people who have access to the source code for the Autopilot system.
Teslas are banned from military bases in China and personnel there are not allowed to drive the cars. This is because they actually record video to make the AI better - there may be sensitive information in such areas, which is why the Chinese authorities have restricted access. It makes sense: military areas often have a photo ban no matter where you are in the world.