It would literally take nearly a treatise to answer this question and it would still be more theoretical rather than practical, as the answer to this question will inevitably be one largely born of a variety of licenses and contractual agreements and will differ with each production. What follows is only an overview of the typical course of how these converging rights get addressed and parsed out.
In a stage play or a film, the producer(s) are the ones who fund or raise all the money without which the production would never come to fruition. They are the ones responsible for the underpinnings of all the manner of IP that goes into a production. As you (likely) know, the production will begin with a writing (the script), to which copyright originates with the author (unless the work is commissioned from the beginning). However, it is not always that a producer's vision begins with a pre-ordained screen or stageplay. It may begin with a book, or an article, or a short story, etcetera, that may then be transitioned into a piece that can be performed. This transition may or may not be created by the originating author; in the case of not, the built upon work would result in its own, new copyright.
So, while the producer may not be the author, or even responsible for the vision behind of the original idea for the screenplay, without their imagination, planning, and money - a film or stage project is unlikely to ever be....well....produced. Throughout the entire process, it is typical that the producer (actually, the producers' lawyers) will negotiate multiple agreements that define how the IP rights will be dispersed from inception to a project's completion. A production includes creative material that would, if created independent of the whole, give rise to numerous copyrights vested in a variety of individuals. This would be very messy to say the least, and would be untenable when the goal is one cohesive work when the final version is complete. Practically speaking, if everyone retained an individual copyright in their creative contribution, it would be analogous to each thread claiming responsibility if not ownership for the shape of the garment.
When a production agreement is drafted, it will typically result in the final rights vesting in one entity (although not always); this, usually being the producer/production company, and from that agreement varying rights of remuneration will flow to the various contributing entities.
While the producer/production company will typically own all the combined copyrights to a given production as a whole when the production is finalized, there will likely be licenses or limited copyrights retained for the explicit use of the parts in separate endeavors (eg. soundtracks or the right to perform a score one composed). Since the input of the various creative contributors will be used in the production of the whole, each contributor is remunerated in a variety of ways. This can be anything from the commissioning of a work whereby a lump payment creates the ownership of the copyright, to payments for the work as it occurs, to royalties for each time a work is viewed or sold in reproduced form, to partial ownership rights in the completed work (much more rare) or any combination of these things.
These agreements are foundational to any production, as without them, courts throughout the world have recognized, and alike failed to recognize, various copyrights in all manner of contribution. They (the agreements) arise out of the combined tenets of copyright and contract law, and are typically known as or referred to as chain of title documentation. This conglomeration of titles, licenses, contracts, copyrights, trademarks and so-on, are how this equation is resolved. It is different with each production, although there are formulaic ways of compiling these chains of titles
(See: From Script to Screen; What Role for Intellectual Property at http://www.wipo.int/ip-outreach/en/ipday/2014/ip_and_film.html as well as
http://www.wipo.int/edocs/pubdocs/en/copyright/950/wipo_pub_950.pdf Securing Rights for a comprehensive discussion of the varying types of agreements producers need to negotiate.)
Just think, each production, at minimum, has: a script, a variety of actors (who may have copyrights in their performances, separate from the scripted words), directors whose vision lends to the flow of the work, cinematography, costume designer and creators, make-up artists (if unique enough, their designs can hold copyright-for example a certain henna tattoo design), stage/set designers and creators, musical scores that were composed and performed (rights flow to each), and myriad other creations that go into a production.
These chain of title compilations are some of the most lengthy and complex commercial transactions arising under IP law, with so many moving parts to draft, negotiate, revise, renegotiate and finalize. This legal process alone can often take up the bulk of preproduction planning and expense.