The addition of the settlement system in Fallout 4, allows for the Sole Survivor to assign any of their settlers to a store, allowing for their own merchants to be created, which in turn will begin providing a small amount of caps overtime to the each respective settlement's workbenches.
Certain NPCs in the Commonwealth, however, will provide much better equipment and junk than just random settlers, including the sale of unique (legendary) armor. Dubbed as the "level 4" merchants, they appear to only provide their bonus equipment in level 3 stores and almost always outperform a random settler in terms of quality and quantity, provided they are assigned to their specialized store.
The most difficult to obtain "Level 4" merchants will only work for a player's settlement if the population of itself and settlements connected to it by supply lines all total to a certain amount of people, with the largest demand being 30 people.
Randomly encountered on any road within the Commonwealth.
Shipments[]
Some merchants offer bulk shipments of crafting components within their junk inventory. Shipments are of either 25, 50 or 100 units, depending on the rarity of the components. Shipments are the fastest way to get rare components for crafting advanced mods, so long as the Sole Survivor can pay for them.