To understand chords, I find some history helpful.
The earliest Western music we know about is chant. ("Earliest" in this case meaning the first music where we can "connect the dots" to modern music.) In its simplest form, chant is one person singing one pitch at a time: melody, but only melody.
Eventually, musicians discovered that one could create a very compelling musical effect by accompanying a melody with a drone, a single sustained pitch. In the loosest sense, this is the "invention" of chords: more than one simultaneous sound, or put another way, more than one simultaneous voice.
From there, an evolution occurred in which a second drone was added, and then a second voice which moved in parallel with the melody.
This general practice — of having one or more drone or parallel voices — is called organum (Wikipedia: Organum).
The history described here is illustrated in the video "Early Organum" by David Goodall.
The "invention" of chords
Eventually, musicians began to make these various voices truly independent of each other. That is, rather than singing a single pitch, or a melody that moved in lock step with another, it was more like two people each singing a different song, but where those two songs blended together in a pleasing way.
One of the masters of this was the composer Palestrina (Wikipedia:
Palestrina), whose music was considered the model for the next century or so. One of his most important works was his Pope Marcellus Mass, which can be heard here, performed by the Tallis Scholars.
Composers and theorists began to study these independent voices to understand how certain simultaneous notes moved most effectively to another set of simultaneous notes. This, essentially, is the "invention" of chords: a theoretical construct to describe how one set of pitches moved to another set of pitches (a "chord progression"). The composer/theorist most credited with our modern way of thinking about chords, is Jean-Philippe Rameau (Wikipedia: Rameau.
Chords as musical tools
As composers shifted from considering independent melodies to thinking in terms of the movement of chords, chords took on a life of their own. They are both a set of notes played simultaneously, but also a descriptive tool for describing the sound of a piece of music.
Especially in jazz and popular music, songs are often written as a melody with a set of chord changes describing the overall sound desired. It's then up to the various musicians to "realize" those sounds, those chords.
In Classical music, chords are more "built in", in that the composer indicates more precisely what should be played and when.