The base, NaOEt removes one of the acidic protons of the CH2 group. They are very acidic due to the electron withdrawing esters. The resulting anion is stabilised by resonance through the ester carbonyls.
Methyl iodide is the electrophile and is attacked by the carbanion to give the methylated compound.
Rinse and repeat for the remaining CH to give the dialkylated compound.