Flux and rosin are in solder to help remove oils and oxidation from the surface of the two metals that you want to join together.
Electronics tends to using rosin core, while plumbing will use flux core. The main reason is that the flux has an acid base and the acid can damage delicate electronic parts.
Here is a good site that explains it all:
http://store.curiousinventor.com/guides/how_to_solder/kind_of_solder/