Enolates of carbonyl compounds will add to an α,β-unsaturated carbonyl compounds to give 1,5-dicarbonyl compounds. This is called the Michael reaction.
Enolates are excellent nucleophiles; although a second resonance form is present with the negative charge on oxygen, the resonance form with the negative charge on carbon tends to be more important for determining reactivity.
Notes: Note that in each case a carbon-carbon bond is being formed
Removal of a proton from the ketone with strong base (Step 1, arrows A and B) results in an enolate, which then performs a 1,4-addition on the α,β-unsaturated carbonyl compound (Step 2, arrows C and D), which is then protonated (Step 3, arrows E and F).
Sodium here isn’t specifically important, it just balances out the negative charge.