Immigration and refugee law are concerned with all the legal aspects of the admission of foreign nationals into your country. In Canada, the Immigration and Refugee Protection Act (IRPA) is the primary piece of legislation that governs this. The IRPA was passed in 2002 and replaced the former Immigration Act of 1976. Foreign nationals largely enter Canada under two types of classes: Family class and Economic class. A potential immigrant qualifies under the family class if they have a family member who is already a permanent resident or citizen of Canada that is willing to sponsor their entrance into Canada. A potential immigrant qualifies under the economic class if Immigration Canada deems the particular candidate to be likely to find a job and contribute to the economy of Canada. They make this decision based on the candidate's education, wealth, work experience, etc.
Foreign nationals can also enter Canada under refugee status. Refugees are anyone who needs to come into Canada for protection because they fear unfair persecution in their home country. This includes persecution based on race, religion, political leanings, or nationality. Foreign nationals can gain refugee status in Canada by either starting a claim on their own (and then getting it approved) or by being sponsored by a permanent resident or citizen of Canada.