Resources: Yes, you can do that, but not right away. The game only lets you swap resources around on turns when you either a) get a new resource to assign or b) get a new slot on a settlement or both.
Declarations: You can see details of how a leader feels about you in two ways. On the main map, mouse over the icon for the leader's status and get a popup with plusses and minues. If you click on the leader, choose the "heart" tab to see details about why they like or dislike you. I play on Sovreign difficulty. The AI declare on me when they are hostile and when they perceive that I am relatively weak. If I move my troops from (say) north to south to attack a different opponent, the northern neighbor might declare because my cities/towns are not well defended.
But the biggest reason the AI declare on me is alliances. If I'm at war with their ally, sooner or later they will declare on me. Even if I'm much bigger and better armed. Check the "heart" tab to see who is allied with whom. If you make peace with leader A, you will need to make peace with their allies as well. If one declares on you, or you declare on them, the chain reaction begins again. If one of *your* allies goes to war, you will be asked if you want to also join the war. That can restart the chain reaction.