The United States Constitution says nothing about immigration. Its creators left it to the states to control how many new people came in.
New York has the highest number of immigrant arrivals, and it was first to set guidelines. The first rules were meant to keep out those who could not support themselves. The rules also barred people with contagious diseases.
As immigration grew, the federal government took more responsibility for controlling it. The first national law was enacted in 1875. It mostly kept out criminals. After a surge of immigrants between 1880 and 1920, the government set quotas from each country. These were based on how many people of that ancestry were already in the U.S. The policy helped northern Europeans but cut the number of immigrants from other nations. Since then, immigration limits have gone up and down, depending in part on the U.S. economy. One result of strict regulation is a large population of illegal aliens. They aren’t qualified to immigrate legally, but they still want a better life. So they manage to enter the U.S. somehow. Most live in fear of being sent back to their native countries.