Every repository hold a Release file that clients will look for when preforming apt commands.
The Release file holds information about the available dists and components (such as bionic main universe and etc.).
It specifies the locations and hash sums of every component.
Once getting the relevant dist, the client then searches for a package list, containing every available debian, its location, its full name, version, hash sums, size and more.
That is how you can differ packages from one repo to another.
If you would like to request a specific version or a target repo, you'll need to use the -t option while using apt-get.
If that version exists in the repo, it will be downloaded.
Note: when choosing a specific repo, it first must exist in the source list.
Below a quote from apt-get man page:
-t, --target-release, --default-release
This option controls the default input to the policy engine, it creates a default pin at priority 990 using the specified
release string. This overrides the general settings in /etc/apt/preferences. Specifically pinned packages are not affected by
the value of this option. In short, this option lets you have simple control over which distribution packages will be retrieved
from. Some common examples might be -t '2.1*', -t unstable or -t sid. Configuration Item: APT::Default-Release; see also the
apt_preferences(5) manual page.