First of all, soldered to be area is heated with the soldering iron.
As solder wire contacts with the area, the solid flux in the wire melts around at 100°C and spreads on the area which makes it clean.
As solder reaches the melting temperature it melts and spreads on fully.
During the spread, an intermetallic layer is formed and soldering is finalizes.