Jazz legend Wynton Marsalis and his virtuoso Jazz at Lincoln Center Orchestra treated a Sanders Theatre audience to a three-hour master class Thursday evening that re-created a pivotal quarter century of jazz innovation against the backdrop of American history.

His combination lecture and performance, “Setting the Communal Table: The Evolution of the Jazz Orchestra,” centered on jazz’s exploding popularity from the 1920s to the early ’40s. It was the penultimate in a six lecture-performance series by Marsalis sponsored by the Office of the President and the Office of the Provost, with the goal of fostering “a conversation about the arts on campus,” according to Harvard President Drew Faust, who attended the event.

A nine-time Grammy Award-winner and the first jazz musician to win a Pulitzer Prize for music, the New Orleans-born trumpeter and composer showed his skills as a teacher, not just of the music but of its social and historical underpinnings. Marsalis said that “the jazz ensemble reflected America itself,” both the good and bad, working together, allowing for group harmony while making space for individual brilliance, but also capable of having “intractable divisions,” and carrying a history of racial segregation.

Marsalis explained how a song was arranged, asking his instrumentalists to perform snippets, and then layering those atop each other to build the larger musical composition. He took the audience under the hood of great jazz to explain how its powerful engine was built.

Prohibition, explained Marsalis, accelerated the craze for jazz, which “was happy to serve its traditional function of being grease for a good time.” He proudly described the central role of his home city, always a melting pot of cultures, in shaping the music. Early ’20s jazz, when performed by segregated white bands, was mostly “genteel dance music” that “only occasionally allowed musicians to let loose” with solo virtuosity, he said. New Orleans’ Jelly Roll Morton would change all that, with innovations such as “a rhythm section that really grooved,” as well as “solo spaces that were passed around” to instrumentalists, creating a free-flowing ensemble style. Morton promoted the sonic polyphony that made New Orleans famous, said Marsalis: “It sounds like noise, but it sounds great.”

Marsalis broke down the ensemble performance of Morton’s “Black Bottom Stomp,” explaining how the polyphony was built with trumpet and trombone at the sonic forefront and clarinet underneath. Under the aegis of Morton and great instrumentalists such as trumpeter Louis Armstrong, solo virtuosity became a major component of ensemble jazz performance, said Marsalis. As his band played, Marsalis often leaned casually on the piano, sometimes chatting with pianist Dan Nimmer or having a chuckle with band members such as saxophonist Sherman Irby, then punctuating song endings with a satisfied “mmmm!”

Marsalis said the jazz ensemble reached its pinnacle with the arrival of Duke Ellington in the late ’20s. Ellington developed his arrangements and compositions “to accommodate the skills of the great soloists” in his band, such as trumpeter Cootie Williams and clarinetist Barney Bigard. Indeed, Marsalis played his trumpet for the first time when his band performed Ellington’s brilliant “Old Man Blues.” Former Duke Ellington Orchestra saxophonist Joe Temperley played right along with Marsalis and the ensemble. Great soloists of the era, noted Marsalis, pushed each other. “The musicians were interested in each other and each other’s virtuosity,” he said, and the music adapted to accommodate their genius.

One of the evening’s highlights was the orchestra’s foot-stomping, pulsating performance of the Count Basie Orchestra’s signature song, “One O’Clock Jump.” Marsalis’ ensemble was precise and perfectly coordinated, but also performing with a joyful expressiveness and swinging abandon, especially during instrumental solos that left many saying “mmmm!”

Marsalis detailed how segregation contaminated jazz, and how white jazz legend Benny Goodman courted ostracism when he began performing with African-American musicians in the late ’30s. But, as Marsalis deadpanned to audience laughter, “the nation somehow survived” white and African-American musicians swinging together. Marsalis explained the music’s inclusive philosophy as “come together, be together, stay together.”

Improvising both musically and verbally, when he tripped over pronunciation of a word, he simply repeated it slowly, then invoked fellow trumpet legend Miles Davis, who said, “I don’t know if a note is wrong until I play the next one.” Throughout, the orchestra remained tight as the proverbial drum, performing with ensemble and individual virtuosity that earned multiple standing ovations.

Marsalis closed by describing jazz as an inclusive music for people “who feel it so deeply that they can’t help but share it,” saying that jazz creates a community of musicians who create communities of those who appreciate it.

That feeling of artistic community, expertly nurtured by Marsalis and his orchestra, was abundantly on display in the rollicking, music-filled theater. When Marsalis explained that jazz ensembles create “a great range of expressive possibilities,” he also described the evening.