When wars go badly, people on the side that is losing tend to want to escape from the unfavorable situation that they are in. Thus, as the war turned in the favor of the Union, more and more blacks ran away, and more and more Confederate soldiers deserted.