Vendors are NPCs who buy/sell items to/from players. Some vendors are capable of repairing items; typically these vendors will sell weapons and armor, or supplies for blacksmithing or engineering. Vendors representing a certain faction are known as quartermasters, and will only sell items to players who have achieved a certain reputation level. However, they will still buy items from players.
A vendor sells items for four times what they will buy them for; that is, if you bought an item for 20 silver, you could only resell it for 5 silver. Items which have no discernible purpose but to be sold to a vendor are called vendor trash. The act of selling something to an NPC is known as vendoring.