Apple Music and Spotify are in the trenches of the "streaming wars" -- and Apple is fighting for every inch.

Last week, Apple Music announced it was setting up a global music publishing division, raising eyebrows in the music world, with industry insiders wondering what the move meant.

Typically, music publishers work with songwriters, helping with the creative process and ensuring they collect royalties for their compositions. But Apple Music said this won't be the role of its new division.

An Apple Music spokesperson said that the launch of a music publishing department is not a shift into signing songwriters directly. Instead, it'll allow the streaming service to work more closely and effectively with music publishers that represent songwriters.

Publishing experts believe this is a legal move to ensure songwriters are fairly paid from streaming. But industry analysts say this closer connection could also indicate that Apple Music hopes to earn early releases and unique events -- and to finally gain some footing against front-running rival, Spotify.

What is music publishing?

There are two aspects to the creation of a song: There's the recording of the song, handled by the record label and artist, and there's the underlying composition, or the songwriting.

This split creates two separate copyrights -- and therefore two income streams -- one for the recording and another for the songwriting. The latter is where music publishers come into the picture.

Every time the song is recorded by an artist, or used in an ad or TV show, for instance, the songwriter may be owed various kinds of royalties. One of the roles of music publishers, which represent songwriters, is to ensure that their clients receive the publishing royalties they're entitled to.

What's Apple got up its sleeve?

Streaming services such as Apple Music owe various types of royalties to songwriters. But, as is typically the case, the law moves at a slower pace than technology.

The complex challenge in the digital age is ensuring publishing revenue is paid out correctly to the right people, because the lack or excess of ownership data can be problematic.

That's why Apple Music's move to establish a music publishing division is likely a largely legal decision. Apple hopes to make the royalties process cleaner for its accountants. It'll be headed by Elena Segal, a lawyer who was previously legal director of iTunes International.

But Apple (AAPL) also wants to find new ways to create unique content, speculated Gene Munster, head of research at Loup Ventures. Although artists and songwriters would likely hesitate to be exclusive to a single streaming service, they'd probably agree to offer some priority, such as working together on a promotional event or an early release on the platform.

Who's winning the "streaming wars"?

Apple Music has just half the number of paid subscribers as its rival, Spotify.

Related: Inside the war between Spotify and Apple

Still, Apple Music is gaining ground, said Munster. It has the advantage of being a part of the iPhone operating system, providing an easy way to market the service. Apple Music is currently growing at a rate of 5%, and Spotify at 2%, according to the Wall Street Journal, and it's on pace to surpass Spotify (SPOT) in subscribers this summer.

Cozying up to publishers seems to be a priority across streaming services. In April, Spotify announced its acquisition of Loudr, a company that "builds products and services that make it easy...to identify, track and pay royalties to music publishers."

In a press release, Spotify said the acquisition would contribute to "continued efforts towards a more transparent and efficient music publishing industry for songwriters and rights holders."

As for Apple Music, the representative underscored that it's not moving in a new direction, rather doing what it's always done -- serving the music industry to the best of its abilities.