Of course, chords happen when multiple notes sound together, but these chordal, harmonic, "vertical" features are secondary.
Counterpoint focuses on melodic interaction.
Renaissance composers worked with counterpoint. This type of counterpoint is usually called polyphony.
But Baroque composers were the masters.
Examples here are from Johann Sebastian Bach's massively important The Art of Fugue. The first is a relatively simple imitative counterpoint, the second a canon.



Can you think of a piece you play that has a contrapuntal or imitative texture?