One of the YouTube "CIA former spies" explained it very well (paraphrasing): "we shared the F-35 with them, but we kept about 10% of the technology to ourselves and sold them a variant. That wasn't enough for them, they ran an espionage operation to get the remaining 10%".