Synthetic nebular emission from massive galaxies – I: origin of the cosmic evolution of optical emission-line ratios | Synapse