The CIA, NSA, and FBI are (at least in part) intelligence agencies that gathers information.
The Department of Homeland Security is a bit different; it includes stuff like the TSA, the Coast Guard, FEMA, and the Secret Service.
The Federal Bureau of Investigation has a dual role as an intelligence agency and as the main federal law enforcement agency.
Unlike the other agencies, the FBI is legally allowed to investigate Americans (the other two agencies are, at least in theory, not supposed to spy on Americans).
The Central Intelligence Agency is the main intelligence-gathering agency in the US.
The CIA is tasked with gathering and analyzing information on foreign governments and individuals.
The CIA also carries out “covert operations” with the Special Activities Division and similar divisions.
The National Security Agency is an intelligence agency housed within the US Department of Defense.
The NSA is tasked with gathering and analyzing foreign communication, although, as seen with PRISM, the NSA also has spied on domestic communication as well.
The NSA is also involved in protecting US information.
There are actually more intelligence agencies than just the CIA, NSA, and FBI.
See: United States Intelligence Community
More Resources on Whats the difference between CIA NSA FBI and Homeland security:
Read more about Whats the difference between CIA NSA FBI and Homeland security: