The hydroxide first removes the acidic alpha-hydrogen, which results in an enolate.  
Typically a strong base such as NaOH or KOH is used in this reaction, and dehydration of its namesake products tends to give a conjugated system known as an enal.  The hydroxide first removes the acidic alpha-hydrogen, which results in an enolate.  The enolate then attacks the starting aldehyde, producing an alkoxide that deprotonates a water molecule and creates the beta-hydroxyaldehyde product.  FTP, identify this condensation reaction, the simplest of which produces ethanal, named for the two compounds combined in its product.
Typically a strong base such as NaOH or KOH is used in this reaction, and dehydration of its namesake products tends to give a conjugated system known as an enal.  
aldol condensation