The combination of simultaneous pitches, and the system governing which combinations are used and how they follow one another. It is the organising principle of Western art music and is treated very differently in other traditions.

A vibrating string or air column produces not one frequency but a series: a fundamental and a set of overtones at whole-number multiples of it.
Two notes whose fundamentals stand in a simple frequency ratio share many overtones, and the resulting sound is perceived as smooth. A ratio of two to one is the octave, three to two the perfect fifth, four to three the perfect fourth.
Complex ratios share fewer overtones and produce beating between close partials, which is perceived as roughness.
This gives consonance and dissonance a physical basis, and it is only a partial explanation. Which intervals a culture treats as acceptable varies substantially, and intervals regarded as unusable in one period of European music became standard in a later one, so perception is shaped by exposure as well as by acoustics.
A chord is three or more pitches sounded together. The triad, built from a root with a third and a fifth above it, is the basic unit.
Major and minor triads differ by a single semitone in the middle note, and the difference in character between them is among the most reliably reported effects in music perception, though its origin is argued.
Chords are related to a tonal centre, the key. Certain chords in a key create expectation of movement toward others, and the dominant chord resolving to the tonic is the strongest such relationship in the system.
Functional harmony describes this: chords have roles, progressions create tension and release, and a piece establishes a key, departs from it and returns.

Voice leading concerns how individual lines move between chords, and much of the rule system taught as harmony is really about producing smooth independent lines rather than about the chords themselves.
Counterpoint, the combination of independent melodic lines, and harmony are two descriptions of the same music from different directions, and the historical development ran from the first toward the second.
Early medieval European music was monophonic, a single line.
Organum from around the ninth century added a second line at a fixed interval, initially fourths and fifths, and thirds were regarded as dissonant.
Polyphony developed through the medieval and Renaissance periods, with increasingly independent lines governed by rules about which intervals could occur and how dissonance had to be prepared and resolved.
Functional tonality consolidated during the seventeenth century and dominated European art music for roughly three hundred years.
Chromaticism increased through the nineteenth century, weakening the sense of a stable key, and the early twentieth century produced systems that abandoned tonal centres altogether.
Jazz developed an extended harmonic vocabulary with added notes and substitutions, and popular music has generally used a simplified functional harmony with its own conventions.
Simple ratios cannot all be satisfied simultaneously on a fixed-pitch instrument.
Stacking twelve perfect fifths does not arrive at a whole number of octaves, and the small discrepancy means a keyboard tuned to pure intervals in one key is out of tune in others.
Historical tunings distributed the error unevenly, leaving some keys pure and others unusable, which gave keys distinct characters.
Equal temperament divides the octave into twelve equal steps, making every key equally usable and none exactly in tune except the octave. It is treated in its own capsule, and it is the compromise on which the Western keyboard repertoire depends.

Harmony in the Western functional sense is not a universal feature of music.
Indian classical music is melodically and rhythmically elaborate and largely non-harmonic, with a drone providing a fixed reference rather than a chord progression.
Gamelan traditions of Indonesia use layered simultaneous parts related by rhythmic density rather than by chordal function.
Many traditions use parallel motion, drones or heterophony, in which several performers vary the same melody simultaneously, rather than chord progressions.
Treating Western functional harmony as what music develops toward is a projection rather than an observation, and traditions that lack it are not earlier stages of it.
Harmony is the dimension along which Western music is primarily organised, and the expectation and resolution it creates is the main source of the emotional trajectory of a piece.
Its physical basis in the overtone series is also one of the clearest cases where an aesthetic system rests on a fact of acoustics, while the extent to which the specific system is culturally rather than physically determined remains genuinely open.