Let's suppose a software development company got a new client and is starting a project for this client. The company hired a new team of developers and testers. And then the client decides to close the project (for whatever reason, it doesn't matter). What about these hired employees? How is this treated in project management?
When a project ends, the resources used for the project are released. For people working on the project, this can mean that they are split into other teams and assigned to work on other projects, or they can be let go if the company doesn't have any other projects to have them work on.
Normally, when hiring new employees, a company should think long term about what will happen with those people once the project ends and where else they can use their skills. But in some cases, people are simply fired. Most companies aren't charities after all. If they can't afford to pay them to do nothing until they find other projects for them to work on, then they have no choice but to let them go.
So this isn't something handled only by project management (with a role in the closing phase of the project), but something that the business as a whole needs to take into account.
Some firms have a healthy budget for bench resources, because holding them on the bench is less costly than recruiting, at least to a certain point in time. And those employees can be assigned overhead work that is very beneficial to the enterprise. For firms that have no bench budget, those employees are released from employment, likely immediately.