In scientific nomenclature, a synonym is a scientific name that applies to a taxon that (now) goes by a different scientific name, although zoologists use the term somewhat differently. For example, Linnaeus was the first to give a scientific name (under the currently used system of scientific nomenclature) to the Norway spruce, which he called Pinus abies. This name is no longer in use: it is now a synonym of the current scientific name which is Picea abies.
Unlike synonyms in other contexts, in taxonomy a synonym is not interchangeable with the name of which it is a synonym. In taxonomy, synonyms are not equals, but have a different status. In general, for any taxon with a particular circumscription, position and rank only one scientific name is considered to be the correct one at any given time (this correct name is to be determined by applying the relevant code of nomenclature). A synonym is always the synonym of a different scientific name and cannot exist in isolation. Given that the correct name of a taxon depends on the taxonomic viewpoint used (resulting in a particular circumscription, position and rank) a name that is one taxonomist's synonym may be another taxonomist's correct name (and vice versa).
Synonyms may arise whenever the same taxon is described and named more than once, independently. They may also arise whenever existing taxa are changed, as when a species is moved to a different genus, or two genera are joined to become one, etc.
To the general user of scientific names, in fields such as agriculture, horticulture, ecology, general science, etc., a synonym is a name that was previously used as the correct scientific name (in handbooks and similar sources) but which has been displaced by another scientific name, which is now regarded as correct. Thus Oxford Dictionaries Online defines the term as "a taxonomic name which has the same application as another, especially one which has been superseded and is no longer valid." In handbooks and general texts, it is useful to have synonyms mentioned as such after the current scientific name, so as to avoid confusion. For example, if the much advertised name change should go through and the scientific name of the fruit fly were changed to Sophophora melanogaster, it would be very helpful if any mention of this name was accompanied by "(syn. Drosophila melanogaster)". Or to give another example, a mention of the name Apatosaurus is much helped by the addition "(syn. Brontosaurus)". Synonyms used in this way may not always meet the strict definitions of the term "synonym" in the formal rules of nomenclature which govern scientific names (see below).
Changes of scientific name have two causes: they may be taxonomic or nomenclatural. A name change may be caused by changes in the circumscription, position or rank of a taxon, representing a change in taxonomic, scientific insight (as would be the case for the fruit fly, mentioned above). A name change may be due to purely nomenclatural reasons, that is, based on the rules of nomenclature; as for example when an older name is (re)discovered which has priority over the current name. Speaking in general, name changes for nomenclatural reasons have become less frequent over time as the rules of nomenclature allow for names to be conserved, so as to promote stability of scientific names.