An intelligence agency is a government agency. Its job is to collect, analyse, and use information to support its government.
There are two parts to this, and usually they are done by separate agencies. The first part is to collect information (to "spy") on other countries. The other side is to watch people in the home country who might cause problems. A third activity is to defend against foreign intelligence agencies in the home country. This is called counter-intelligence, and is often done by a separate agency.
What the agencies discover is called "intelligence". It may be used to help law enforcement, security, defence and foreign policy.
The methods of information gathering are sometimes covert (hidden) and sometimes quite open. A covert method might be to steal and copy secret documents. An open method would be to read all published work on some important matter, and analyse it. Much important material is published openly in democratic countries.
To get hold of secret information, these organisations use espionage, intercept signals (tap phones, hack computers), cryptanalysis (break codes), and think about what the information means. Putting together and communicating information is known as intelligence analysis and assessment.
Some agencies have been involved in assassination, arms trafficking, coups d'état, and the placement of misinformation (propaganda) as well as other covert operations, in order to support their own or their governments' interests.