The flexoelectric effect is the coupling between strain, polarization, and their gradients, which are prominent at the nanoscale. Although this effect is important to understand nanostructures, such as domain walls in ferroelectrics, its electronic mechanism is not clear. In this work, we combined phase-field simulations and first-principles calculations to study the 180 degrees domain walls in tetragonal ferroelectric PbTiO3 and found that the source of Neel components is the gradient of the square of spontaneous polarization. Electronic structural analysis reveals that there is a redistribution of electronic charge density and potential around domain walls, which produces the electric field and Neel components. This work thus sheds light on the electronic mechanism of the flexoelectric effect around 180 degrees domain walls in tetragonal ferroelectrics. Published by AIP Publishing.