Adjusting the nuts on the swing arms simply changes the position of the rear sprocket, moving it closer or further away from the drive sprocket, and/or changing the alignment of the wheel.
The diagram above doesn't show it, but the position of the rear sprocket (along with the whole back wheel assembly) is not fixed, but actually can move along the swing arm(s). This picture should show it more clearly:
When you push the rear sprocket further away, you increase the distance between the sprockets and consequently reduce the chain slack, making it tighter.
On dual swingarm motorcycles, to help with keeping the back wheel aligned, you will see some equidistant notches put in the area your are adjusting. You must adjust on both sides the same distance to keep your wheel aligned. Or if it's not aligned, to start with, then your can use this mechanism to align it.
Don't forget to check your manual for the amount of slack you need to have (the chain doesn't need to be too loose or too tight). Check for wear of the chain and rear sprocket. And clean and lubricate your chain.