Merchants and Marauders NPC Combat Decisions
This is quite a controversial question that has already been extensively discussed on BGG [1][2]. The general consensus is that you should play the NPC as if you were the NPC captain and it was your own ship, even to the detrimental of your own captain. Examples:


The NPC neither plays no politics nor it has any knowledge of the scoring board. You should try to sink it even if that means letting another player win.
Boarding "should" only occur when the NPC is "sure" that they can win. Otherwise, if you just roll for boarding without good chances, just to let the human player inflict damage or escape, then you are not trying "hard enough" to win.
Remember that the official rules state that an NPC can only try to flee if either their cannons or their crew are less than the respective stat of the human player. Therefore, it's perfectly fine to try to flee at that point, albeit should the NPC be on the verge of sinking the human player, then such a decision may be controversial.


Controlling the NPC is, overall, a delicate situation. In a single phrase, it can be summarized as do your best to sink/board the enemy ship, even if it means going against your own captain (you were planning to attack that player) or letting a third player win.