The premise is that the alignment that gives the lowest cost on the best tree that can be found for that alignment is the most optimaly parsimonious alignment. This then needs to be evaluated for its cost. There are three trees for the four taxa that the alignment can be evaluated on. Because the second alignment is more optimal than the first, we discard the first, keep the second and swap on the alignment topology again. We can keep doing this until we are satisfied that we can't get a better alignment.
Most people like to point an shoot.
Alas, good science is more difficult than this. In order to help you get a handle on some of this, there is MalignOnlign and you should read the Malign Manual .