Completely random, you may find a masterwork bow in a rhodok city, or a masterwork crossbow in a nordic city or any other thing at any other town, anything can appear anywhere. Visit the weapon merchant regularly, since they list their wares by price, masterwork weapons (and lordly armor for the armor guy) usually come on top.
Masterwork weapons can also appear after regular battles, like getting a masterwork khergir bow from fighting lots of khergit troops, of the occasional masterwork sword or longbow from bandits. However, since no army carries top of the line equipment, like the sword of war, plate armor (sword sister do, ok, but still, they're too rare), war bow, bastard sword, etc, the chances of getting one from war are none, let alone a masterwork version. For these pieces of equipment you have to go look in towns. The most expensive piece of equipment in native is the lordly plate armor by the way, which goes for in between 100k and 150k denars if I remember correctly, so if you've got more than that, you're set.