Since the PM knows what it takes to deliver the project, they have the best sense of what resources they need. So, in a typical scenario, the project managers ask for resourcing based on their own project needs, insulated from the organizations resources and other needs. This is typically referred to as the resourcing plan, and is aspirational. Then, someone from the organization (either an overall resource manager, or HR or director, or anyone else who is looking across multiple projects) combines all these requirements into one combined resourcing plan and then suggests people on different projects by looking either inside the organization or outside. They may shuffle people around, open new positions for internal/external recruiters to fill, etc. The team members allocated on the project become the project team.
Project Managers continue to evaluate staffing gaps between people they ASKED for (the project's resource plan) and the people they GOT (the project team). This gap is basically the project's staffing gap. In some cases gaps may be in terms of quantity (asked for 4 translators, got 2.5), or in some cases in terms of quality (asked for 4 senior lawyers, but got 2 lawyers and 2 interns).
Mathematically: staffing gap = resource plan - project team. Following snapshot can help:
Resource Managers continue to minimize the gaps.
In case there is no one specifically tasked with being a resource manager, that role can sometimes be done by senior management, or a project portfolio manager.