WinMerge compares files. It shows you the differences. It also allows you to copy the differences, also called "merge" instead of "copy" (hence the program name), one by one, from one file to the other (in either direction).
Using it to merge source code is potentially problematic. It has no understanding of what the code actually does so you can run into problems, particularly when the part of the code you are merging something into has already been modified in some other way. Example:
original code has "if A"
modified to "if A or B" in some mod component you already added
then the next thing you are merging has it as "if A or C".
WinMerge's change copying mechanism would replace the 2nd with the 3rd, wiping out the change that allowed for thing B. The correct merge, which you'd have to do manually, would most likely be "if A or B or C".
It is very useful, but has some limitations. Especially with source code or XML where there are a lot of similar lines. For example, adding even a short function that is similar to the ones around it (as they often are) tends to cause it report multiple differences instead of just one, sometimes throwing it out of synch for the rest of the file (or a large chunk of it) and report hundreds of non-existent differences as it is comparing the wrong parts of the files to each other. It can do the same thing if you add something to the XML, say a new unit in the middle of the unit info file - most of the lines are likely to be the same as in the now following unit and when WinMerge gets to taht part of the comparison it doesn't recognize that it is a single new UnitInfo tag, along with everything inside that, rather than a bunch of changes to individual lines. I have run into this sort of issue on numerous occasions. But even with the limitations it is still a very useful tool.