Economics is the study of the allocation of scarce resources in the production and consumption of goods and services. Mankind has finally entered a stage where the economy tends to increase at a positive rate owing to scientific understanding and the mastery of the physical world through technology. If humanity survives past its current critical phase (Type 0), the economic expansion will likely continue until the energy of the nearby galaxies has been exhausted and the Universe gradually begins to die a particle death.
During large periods of human evolution such was not the case. Resources and technology were stagnant. One person's average gain was another's average loss. Accepting immigrants into the community or yielding resources to a nearby tribe could have been an existential threat to a population's genetic prevalence. Thus humans have evolved with an inherent suspicion of outsiders and reluctance to trade with them. It works well as an evolutionary survival strategy on the African forest or Savannah, but is a very poor strategy for expanding wealth and resources in a positive-sum, technologically advancing civilisation. Without education to overcome the protectionist genetic instincts of primitive man or similar memetic cultural exclusivity, politics and laws end up restricting trade and immigration in very unproductive and uncooperative ways to the detriment of everyone.
Paul Rubin has written a very interesting piece about this. Via Mankiw.