What determines the cloud-to-ground lightning fraction in thunderstorms?