The Department of Homeland Security is a huge agency with the mission "to secure the nation from the many threats we face." Congress created DHS in 2002 to combine 22 different departments into one unified agency.
Three of the DHS sub-agencies are mainly involved in immigration/border matters.
U.S. Citizenship and Immigration Services
U.S. Citizenship and Immigration Services (USCIS) is a sub-agency of DHS. It administers immigration laws by processing immigrant and non-immigrant benefit applications. It focuses only on applications because U.S. Immigration and Customs Enforcement (ICE) and U.S. Customs and Border Protection (CBP) handle immigration enforcement and border security.
Mission
According to its website, its mission is to administer the "nation’s lawful immigration system, safeguarding its integrity and promise by efficiently and fairly adjudicating requests for immigration benefits while protecting Americans, securing the homeland, and honoring our values."
Activities
What does the agency do? The USCIS website provides a list of the agency's daily activities.

U.S. Immigration and Customs Enforcement (ICE) is a sub-agency of DHS that is its investigative arm. Two of its main responsibilities are to enforce immigration and customs laws by:
Mission
Its mission is "to protect America from the cross-border crime and illegal immigration that threaten national security and public safety. This mission is executed through the enforcement of more than 400 federal statutes and focuses on immigration enforcement and combating transnational crime."
Activities
What does the agency do? The following is an infographic from the ICE website that summarizes its daily activities.

U.S. Customs and Border Protection (CBP) is a sub-agency of DHS which prevents people from entering the country unlawfully, or bringing anything harmful or illegal into the United States.
Mission
According to About CBP, the agency is "one of the world's largest law enforcement organizations and is charged with keeping terrorists and their weapons out of the U.S. while facilitating lawful international travel and trade. As the United States’ first unified border entity, CBP takes a comprehensive approach to border management and control, combining customs, immigration, border security, and agricultural protection into one coordinated and supportive activity."
Activities
What does the agency do? The agency provides a list of daily activities.

Executive Office for Immigration Review (EOIR) is a sub-agency of the Department of Justice which adjudicates immigration cases and appeals of immigration decisions.
Mission
According to the website, its mission is "to adjudicate immigration cases by fairly, expeditiously, and uniformly interpreting and administering the Nation's immigration laws. Under delegated authority from the Attorney General, EOIR conducts immigration court proceedings, appellate reviews, and administrative hearings."
Activities/Statistics
The website contains statistics about the agency's workload.

The Bureau of Consular Affairs (CA) is a sub-agency of the department of state.
Mission
According to the website, the agency's mission is to be " responsible for the welfare and protection of U.S. citizens abroad, for the issuance of passports and other documentation to citizens and nationals, and for the protection of U.S. border security and the facilitation of legitimate travel to the United States."
Activities
The website provides an infographic about the agency's activities.
