Depends on a few factors, AFAIK as a non-lawyer. If the license allows closed-source derivatives (i.e. is permissive rather than copyleft), then anyone can create a closed-source version with all of the contributors' changes, including the original maintainer. And anyone can choose to keep it open-source. The community contributions still to some extent belong to the contributors, though the license waives most of their rights.
Some projects are copyleft, but contributors are required to sign a license agreement (a CLA) which allows a single entity to change the license as they desire, including to closed-source - this is a good reason to avoid such projects. The contributors don't own their work in such a case, but they can still fork the old project as it was before being taken closed source.
In a copyleft (e.g. GPL) project with no CLA, it's illegal for anyone to make a closed-source version, and a major contributor could sue even the maintainer for doing so.
In all such cases, the change to a closed-source model does not erase the existence of the open-source code with community contributions. A fork is always possible.