By default under international copyright law, all copyright is owned by the person who wrote the code (or owned by the company they work for if they are an employee, or owned by the client who hired them if they are a subcontractor).
With open source projects, there can be dozens or hundreds or even thousands of people who own copyright on a project. This means all of them own the copyright and any copy must be authorised by all of them.
There's no one person who owns copyright, the original company who previously owned all the copyright now only owns part of it and therefor they have to get permission from all other contributors to make copies.
By having a well written license (such as MIT or GPL) attached to the project all of the copyright holders have clearly given the world permission to make copies with certain restrictions, and this means that anybody can do so without having to ask for permission from everybody.
The only time this really becomes a problem is when you do not want to comply with the restrictions of MIT or GPL. For example the VLC project tried to put their product on Apple's Store but this isn't allowed in their license and somebody sent a legal threat to Apple, resulting VLC being from the store. Since the license doesn't allow deploying on the store the only way to do so is with written permission from everybody who has ever contributed to the project.
Another (less common) way to approach the issue is for all contributors to assign copyright to the company/foundation who runs the project using a "Copyright Transfer Agreement". This way there is only one copyright holder and they can do anything without having to comply with the license, since they own all of the copyright.
An example of this is the Java project which was created by Sun and later purchased by Oracle. It is released under the GPL license, but Sun/Oracle also sell the product under a proprietary license that does not include GPL's "copyleft" restrictions. They need to own all of the copyright to take that approach.
Something else to keep in mind is most projects use a good version control system such as Git and this allows you to know exactly who wrote every line of code in the project. This can be used to find who wrote some code so you can contact them for permission, and if they don't respond you could delete all of their code (and also any other code that "derives" from their code... talk to a lawyer to find out exactly how that works).