The public goods game is an explanation to why so often too little is
done to promote the common cause. The idea itself is very simple.
Imagine we have several players. Everyone can decide how much
resources to put into the "common pot". Next, the content of the pot
is multiplied (by a number less then the number of players) and
distributed evenly back to all the players. Obviously, the best
solution for everyone were to invest a lot and gain back even more.
Unfortunately, for every dollar I invest, I receive back less than one
(although I receive a slice of what the others have invested). Hence,
a rational selfish player will not invest anything at all and solely
free-ride on the others investments. As experiments indicate, the
people around us are not quite that bad, but most will still devote
less than optimal amount of resources for the public good.
Now imagine that instead of players, we have countries. The common
pot are the public goods, such as crime prevention or public highways.
Voters in every country are free to pay taxes and build up such public
goods. But afterwards, they are also free to move to whichever
country they want. What would rational voters do? First, they would
pay no taxes, and second, they will move to the country with best
amenities. Sounds like the public goods game, right?
However, for the analogy to work, the public goods must be
non-excludable -- it must be hard to avoid free-riding on the
taxpayers bill. However, from the viewpoint of immigration, many
public goods, usually given as examples of non-excludable goods, are
actually excludable. This includes highways (can be financed by fuel
taxes), social security (can be made conditional on some sort of
contribution period) and public schools (if immigrants can be taxes,
this money can by used for constructing new schools). If population
growth (not just through immigration) is slow enough, and newcomers
pay taxes, you can expand all of the above examples. The
excludability originates from the fact that governments can tax the
(potential) users, and expand the supply through this source of
funding. Note that you still may have a conflict between rather rich
locals and poor immigrants, each preferring a different level and
variety of goods.
What cannot be easily expand include some sort of inherently limited
resources one cannot produce at all, such as minerals, arable land,
but also street space in a busy downtown. Although these are public
goods as well, the public goods game as described above does not
directly apply for these (another one, called "tragedy of commons",
does). There is also a type of amenities which are non-excludable
even in case of countries and governments. This includes information,
environment protection, and other stuff for which national borders
play no role.
In conclusion, free-riding on public goods provided by locals is a
valid but possibly quite weak argument against liberal immigration
policy. Strength of it depends on the degree to which the immigrant
population can be taxed, i.e. whether immigrants are in legal
employment.
Note also that there are more ways immigration and public goods
provision are related. For instance, studies find that more diverse
population leads to less public goods provision, possibly through low
level of solidarity in heterogeneous society. That's a different
story, however.