The malonic ester synthesis is based on the use of diethyl malonate in order to generate a stabilized carbanion.
The carbanion can then react as a nucleophile on a substrate which has a proper leaving group. The substitution on an halogen derivative is probably the most common.
Treating with a base (usually sodium ethoxide) malonate ethyl, you 're able to remove a proton from the carbon located between the two carbonyls (α carbon).
Since the two carbonyls "pull" the electrons of the central carbon , also on it there will be a partial positive charge (δ + ) .
It follows that the same central carbon will attract more strongly the bonding electrons of the C-H bond (this means it becomes even more polarized than normally). The proton (H) is therefore relatively acid.
If this proton is quite acid, the conjugate base, and so the resulting carbanion, will not be a very strong base such as generally are the carbanions (eg Grignard compounds). This condition, together with the resonance, make the ethyl malonate carbanion sufficiently stabilized
Once isolated the anion as a sodium salt, it remains to make it react with a compound of which it is possible to perform on a nucleophilic substitution.Although the negative charge is usually localized on oxygen, the carbanion is a better nucleophile.
Recall that each time that a carboxyl group is located in relation 1 - 3 (that is to say in the position β ) with respect to a carbonyl group, in conditions of acid environment and mild heating it spontaneously loses carbon dioxide.