In 2006, Coca-Cola approached Rohail Hyatt, a Pakistani musician and producer, with an offer he couldn’t refuse: we’ll pay for you to make a live-music show for television. Don’t worry about the money – just do whatever it takes to ensnare the ears and thus the hearts and minds of Pakistanis everywhere.

Hyatt didn’t disappoint. The first season of “Coke Studio”, which aired in 2008, was received with enthusiasm; subsequent seasons with adulation. The show takes viewers inside the recording studio to watch a diverse range of musicians – young and old, rich and poor, Punjabi and Pushtun – perform songs that put Pakistan’s different musical traditions in conversation with each other: devotional Sufi music with pop, traditional monsoon melodies with rock. When “Coke Studio” first aired, the country was in crisis. Benazir Bhutto had recently been assassinated and thousands of people were being killed every year in terrorist attacks and sectarian incidents. The country was tearing itself apart. But for an hour every week, “Coke Studio”, in its own small way, stitched the nation back together again.

“Coke Studio” continues to be a roaring success. According to Coca-Cola, each season since 2010 has been viewed, at least in part, by 90% of Pakistanis who own a TV . Coca-Cola is so confident about “Coke Studio” that it has adapted the format for 24 other countries in Asia, the Middle East and Africa (including some of the biggest: India, Indonesia, Egypt, South Africa and Nigeria).

This isn’t beginner’s luck. For almost as long as the company has existed, Coca-Cola has used music to sell its products. In 1899 Hilda Clark, a dance-hall singer, serenaded the drink in an ad and, in the late 1960s, Ray Charles, Aretha Franklin and many other pop luminaries wrote radio jingles for the company. But over the last decade, Coca-Cola has deepened its commitment to music and is now a major player in the industry. A year after “Coke Studio” first aired, it launched Coca-Cola FM , a music-streaming website in Latin America. In 2012, the company announced a “global strategic partnership” with Spotify. YouTube, Spotify and other streaming services act as gatekeepers to music; now Coca-Cola does too.

Drinking songs Skepta at Red Bull Studios, London. TOP Meesha Shafi on “Coke Studio” in Lahore

If Coca-Cola is mimicking new media groups, other brands are mimicking traditional record labels. In 2008 the fizzy-drink company Mountain Dew launched a record label and music magazine. In 2011 Converse, which makes trainers, opened a recording studio for independent artists in Brooklyn, with connections to sister studios in Italy, France, Brazil and Argentina. Red Bull, the energy drink, also encourages artists to use its global network of recording studios and launched its own record label in 2007 in addition to the many festivals and events it organises and funds.

Why do they bother? Because music is a “passion point”, says Joe Belliotti, director of global entertainment marketing at Coca-Cola; push that point hard enough and a deep emotional connection between consumer and brand will form. The savviest marketing departments know that, today, the most effective way of using music is to make it. Listening habits have fragmented: people still buy albums and listen to the radio, but they’re also buying tracks on iTunes, sharing them on Facebook, streaming music on YouTube, Spotify, Apple Music and Tidal, and attending gigs and festivals in greater numbers than ever before. The best way to capture the attention of digitally minded consumers is to release catchy bits of “content” on the platforms they use.

Gripping shows that inspire viewers to return week after week are better at securing the loyalty of consumers than a 30-second commercial. And branded content can inspire respect. Red Bull has acquired a reputation as a tastemaker in cutting-edge electronica by playing the role of the generous host. It underwrites festivals, organises lectures and posts the music of affiliated artists on its website and social-media channels. “Red Bull has become this cultural library,” says Michael Winawer, a British musician and record-label consultant. “That carries clout in the music world.”

If investing in music has paid off for Coca-Cola, has this enormous branding exercise benefited music? “To the extent that you bring resources and invest in the act of making music, yes,” says Peter Alhadeff, a professor of music business at Berklee College of Music. The music industry is hard up (2015 was the first year since 1998 in which global revenues haven’t declined), and it has long since set aside any lingering concerns about “selling out”. Labels need corporate dosh; so too do artists.

But brands aren’t labels. Their interest in artists is typically short-term, and they “aren’t likely to build superstars or a catalogue,” says Alhadeff. Musicians must recognise that their talent is in the service of a company that cares, ultimately, not about music, but about its product. Belliotti says that Coca-Cola only works with artists who drink and love Coke. Blue, the colour of Coke’s rival, Pepsi, is an issue, especially when artists want to wear it. “We fight the Coke guys a lot over that,” says Faisal Kapadia, a producer of “Coke Studio”. “They have a thick book of Coca-Cola rules: you can’t wear blue, you can’t have blue lights.”

The experience of Rohail Hyatt, who produced the first six seasons of “Coke Studio” in Pakistan, is illuminating. The show was “tailor-made”, Hyatt says, to reflect Coca-Cola’s “values” of “sharing happiness” and putting a refreshing spin on tradition. Conveniently, this value system was sufficiently woolly to accommodate his vision for the music, which he hoped would take risks and have a “timeless” quality. Audiences got it and the show was a runaway success. But by season five, Coca-Cola’s marketing department started pressuring him to cater to a wider audience: boost viewing figures and you increase exposure to the brand. Hyatt left “Coke Studio” in 2013 (though he is still employed by the company as a consultant). His successors, Kapadia and Bilal Maqsood, confirm that the pressure to win over new fans is enormous.

There is no public funding for the arts in Pakistan. The violence that beset the country in the mid-2000s destroyed the live-music scene and spooked many of the foreign record labels, which pulled out. Today, musicians interested in making a living need brand patronage. “It’s basically corporate culture which propels music everywhere,” says Ali Sethi, a Pakistani singer and occasional performer on the show. And the best gig in town is “Coke Studio”. Just don’t see red if you want to wear blue on Coke’s stage. Remember: you’re with the brand.