Controlling the efficiency of electron transport across oxide interfaces is essential for numerous emerging technologies including advanced photovoltaics and light emitting devices. This work illuminates the connections between granular structure, defect chemistry, and the work function of a technologically important transparent conductor, ZnO:Al. Visual evidence is provided for a model of grain boundary oxidation in the form of nanometer-scale heterogeneity in the contact potential between grains and grain boundaries, a phenomenon referred to as electronic granularity. By correlating scanning probe data with photoemission spectroscopy we relate electronic granularity to defect chemistry and, importantly, account for the overall trends in work function. The resulting physical picture connects heterogeneity at the nanoscale to macroscopic properties, informs the design of transparent electrodes, and may be broadly relevant to granular oxide conductors.