This reaction is an example of intra molecular Claisen condensation reaction. The mechanism of the Claisen condensation reaction proceeds with the removal of an alpha proton through the action of a strong base to result in the formation of an enolate ion.
This results the formation products as follows,

