Having local spies means employing the services of the inhabitants of a district.
Most people are just trying to get on with their daily lives. Wars are troublesome for them and can make life much harder.
If the people where the enemy is residing do not like the enemy, then it should be easy to persuade bold individuals, especially those who have been wronged, to spy for you. This is the best type of local spy.
If the local people are suffering hardship, then rewards of money or food may make it worth them taking risks for you.
Worst is to coerce them into spying for you, for example by threatening to ‘expose’ them.