Context. The electrostatic potential of a spacecraft, VS, is important for the capabilities of in situ plasma measurements. Rosetta has been found to be negatively charged during most of the comet mission and even more so in denser plasmas. Aims. Our goal is to investigate how the negative VS correlates with electron density and temperature and to understand the physics of the observed correlation. Methods. We applied full mission comparative statistics of VS, electron temperature, and electron density to establish VS dependence on cold and warm plasma density and electron temperature. We also used Spacecraft-Plasma Interaction System (SPIS) simulations and an analytical vacuum model to investigate if positively biased elements covering a fraction of the solar array surface can explain the observed correlations. Results. Here, the VS was found to depend more on electron density, particularly with regard to the cold part of the electrons, and less on electron temperature than was expected for the high flux of thermal (cometary) ionospheric electrons. This behaviour was reproduced by an analytical model which is consistent with numerical simulations. Conclusions. Rosetta is negatively driven mainly by positively biased elements on the borders of the front side of the solar panels as these can efficiently collect cold plasma electrons. Biased elements distributed elsewhere on the front side of the panels are less efficient at collecting electrons apart from locally produced electrons (photoelectrons). To avoid significant charging, future spacecraft may minimise the area of exposed bias conductors or use a positive ground power system.