1660s, "agreement of two or more in design or plan; accord, harmony," from French concert (16c.), from Italian concerto "concert, harmony," from concertare "bring into agreement," apparently from Latin concertare "to contend with zealously, contest, dispute, debate" from assimilated form of com "with" (see con-) + certare "to contend, strive," frequentative of certus, variant past participle of cernere "separate, distinguish, decide" (from PIE root *krei- "to sieve," thus "discriminate, distinguish").
The proposed sense evolution between Latin ("to contend with") and medieval Italian ("bring into agreement") seems extreme and is difficult to explain. Perhaps the shift is from "to strive against" to "to strive alongside" (compare English fight with), or perhaps it is via the notion of "confer, arrange by conference, debate for the sake of agreement." Some have suggested the sense shifted through confusion of Latin concertus with consertus, past participle of concerere "to join, fit, unite."
Sense of "public musical performance," usually of a series of separate pieces, is from 1680s, from Italian (Klein suggests Latin concentare "to sing together," from con- + cantare "to sing," as the source of the Italian word in the musical sense). The general sense of "any harmonious agreement or orderly union" is from 1796. Concert-master "first violinist of an orchestra" is from 1815, translating German Konzertmeister.