"The valid name of a taxon is the oldest available name applied to it, unless that name has been invalidated or another name is given precedence by any provision of the Code or by any ruling of the commission."
The Principle of Priority affects all aspects of the Code, including validity of synonyms (different names for the same species), homonyms (same name for different species), correct spellings, and the validity of a publication. It means that to be valid, a name must be the first published and available. Any synonyms or homonyms made available after the first are considered junior to the earlier senior homonym or synonym. It also means that when a taxon is formed by combining two or more different taxa, it takes the name of the first described.
While this solves most problems as far as which name can be considered valid, there are still issues that can arise. The most frequent is when long since unused names are discovered for well known taxa. Normally, the junior synonyms would have to be replaced with the earlier senior synonym, but the stability of zoological nomenclature would be widely affected by such an action. Therefore, the International Commission of Zoological Nomenclature can vote to partially suppress (the name is treated as published and available except for the purposes of priority) or completely suppress (the name and/or nomenclatural act are treated as unavailable, as if they had never been published) the offending senior synonym if such a case is brought to them. A good example of this use of plenary power is the suppression of a work by J. W. Meigen (1800) which included many family and genus names which he subsequently changed in his 1804 work. Both sets of names were in use well into the 20th century, but the later names were used more often so the commission ruled against the senior synonyms and suppressed the whole publication as well as several junior homonyms that would be made valid by the suppression (ICZN 1963).
Aside from the above situations, Principle of Priority generally leads to great stability in zoological nomenclature, and while it can be misused (for example, stealing work and publishing first) it easily solves many arguments that may arise due to all other aspects of the Code.
International Commission on Zoological Nomenclature. 1963. Opinion 678. The suppression under the plenary powers of the pamphlet published by Meigen, 1800. Bulletin of Zoological Nomenclature 20: 339–342. [21 October]
Meigen, J. W. 1800. Nouvelle classification des mouches à deux ailes (Diptera L.) d’après un plan tout nouveau. Par J.G. Meigen. “An VIII (1800 v.s.)”. J.J. Fuchs, Paris. 40 p. [before 22 September]
Meigen, J. W. 1804. Klassifikazion und Beschreibung der europäischen zweiflügligen Insekten. (Diptera Linn.). Erster Band. Abt. I. K. Reichard, Braunschweig [= Brunswick]. xxviii + 152 p. [5 November]