Abstract: Electrical synapses play a major role in setting up neuronal synchronization, but the precise mechanisms whereby these synapses contribute to synchrony are subtle and remain elusive. To investigate these mechanisms mean-field theories for quadratic integrate-and-fire neurons with electrical synapses have been recently put forward. Still, the validity of these theories is controversial since they assume that the neurons produce unrealistic, symmetric spikes, ignoring the well-known impact of spike shape on synchronization. Here, we show that the assumption of symmetric spikes can be relaxed in such theories. The resulting mean-field equations reveal a dual role of electrical synapses: First, they equalize membrane potentials favoring the emergence of synchrony. Second, electrical synapses act as "virtual chemical synapses,"which can be either excitatory or inhibitory depending upon the spike shape. Our results offer a precise mathematical explanation of the intricate effect of electrical synapses in collective synchronization. This reconciles previous theoretical and numerical works, and confirms the suitability of recent low-dimensional mean-field theories to investigate electrically coupled neuronal networks. © 2020 American Physical Society.