The latest AMS-02 data on cosmic ray electrons show a break in the energy spectrum around 40 GeV, with a change in the slope of about 0.1. We perform a combined fit to the newest AMS-02 positron and electron flux data above 10 GeV using a semi-analytical diffusion model where sources includes production of pairs from pulsar wind nebulae (PWNe), electrons from supernova remnants (SNRs) and both species from spallation of hadronic cosmic rays with interstellar medium atoms. We demonstrate that within our setup the change of slope in the AMS-02 electron data is well explained by the interplay between the flux contributions from SNRs and from PWNe. In fact, the relative contribution to the data of these two populations changes by a factor of about 13 from 10 to 1000 GeV. The PWN contribution has a significance of at least 4σ, depending on the model used for the propagation, interstellar radiation field and energy losses. We checked the stability of this result against low-energy effects by solving numerically the transport equation, as well as adding possible breaks in the injection spectrum of SNRs. The effect of the energy losses alone, when the inverse Compton scattering is properly computed within a fully numerical treatment of the Klein-Nishina cross section, cannot explain the break in the e− flux data, as recently proposed in the literature.