Flux is a chemical agent used to aid in the process of soldering. It is commonly found in flux core solder wire as well as liquid and paste forms. In Latin, the word flux means flow and this makes sense because it helps solder to flow onto the surface of a work piece.
Imagine a thin layer of oxides on the metal surfaces you're soldering, as long as they're there the solder will not be able to flow. The job of the flux is to dissolve that surface oxidation and keep it clean long enough for the solder to do its job. You don't want it to do anymore or any less than that.
"Good flux goes in, goes out, and it's done. It shouldn't hang around."
The clean surface that the flux provides improves the wetting (adhesion) between the surface metal and the melted solder because it can transfer directly without any interference. This results in the strongest electrical and mechanical connection at the solder joint.
The component of flux that facilitates the flow of solder and holds everything together is called the vehicle. All of our electronic fluxes use isopropyl alcohol as a vehicle because it dissipates easily and doesn't spatter like water when heat is applied to it. If you've ever touched a soldering iron to a hot sponge you know what I mean. The last thing you want is molten solder splattering all over your board potentially causing shorts in the circuit!
Now before you go and grab whatever flux you've got on your shelf, you need to realize there are different types of flux for different applications. Using the wrong flux like an acid flux can potentially destroy your circuit board and all the connections on it.