Almost all the information data is communicated by digital, which makes harder for the intelligence organization to decode, even though they capture the whole information by securing a bottleneck of the network flow.
The issue is how to read data when they are hard to be cracked or how to get an intel not sent through a communication network. The hacking is one of the methodologies for this purpose, which is apparently availed by the intelligence agency.
It is basically the same as trespassing into a base of the targeted organization. For example, if the data is just kept in a paper medium, it is necessary for the spy to break into their location. If this is digitalized, it might be stolen just by hacking, which indicates that the intelligence organization should employ an appropriate methodology to steal an intel, according to a change of time and the hacking is one of the modern plots for a theft.
If the intelligence really would like to obtain an intel, they can hack wherever they want. It is not easy to break into a center of the targeted government as they have also protected themselves from these attacks, but at least, it is not difficult at all for the spy to hack into any places in their own country.
There is a legal restriction to conduct that kind of operations, but it does not mean they have a capability to do so and its prohibition is not necessarily kept by the intelligence agency.
It has become harder as a counterintelligence protective technology is advanced and some of the tech companies manage to keep a distance from the intelligence request in the last several years. In this sense, the hacking becomes more difficult for the CIA or NSA in the United States, but it also does not mean they have a capability.
The intelligence organization prefers to employ a contractor for these illegal hacking, even though they have a capability, as they can avoid a direct condemnation and prosecution.
This tactic is actually quite problematic as their contractor can be immune when their operation is revealed as they work as an asset to the intelligence. In this system, any contracted spy operation cannot be prosecuted, which is apparently a defect in the current legal system related to the intelligence conduct.
This fault is actually seen at the old school methodology. For example, if the contractor has used an illegal methodology to obtain an intel which is revealed later on, this spy cannot be prosecuted due to an immunity. Moreover, the intelligence agency cannot be prosecuted as well, as far as shutting a mouth of this spy not to tell where the real order comes from.
The logical conclusion is that the intelligence organization can conduct any illegal activities by employing a contractor, which also holds true to a contacted hacker. This outcome is too dangerous for the modern democracy that we should make up this defect.