This is a nice story.
As already noted, the chandler is originally an occupation centred around the production and commerce of candles. The name itself comes from the French chandelier, which in addition to designating the candelabrum itself, used to designate a person whose trade it was to make and sell candles.
Since the fabrication of candles also yields soap as a by-product, most chandlers were also in the business of producing and selling soap.
Ships of course with always a proportion of seamen on the watch were natural consumer of candles and they needed to replenish their stocks every now and then throughout their sailing itinerary. There was indeed no compelling reason to purchase the whole stock of candles needed for a given journey in the home port. On the contrary, well advised shipowners would take advantage of the differences of prices for candles and other products in the home port and in the ports of call in order to level down the total expense.
They would therefore enter in global procurement deals with large volume chandlers located in the various ports of call and open a line of credit with each of them.
They would also have their seamen benefit from the deals not only to increase the purchased volumes and get a better deal but also as a deal sweetener towards the crew - possibly lower wages compensated by additional benefits.
Yet for the seamen that actually was a big advantage because they knew were to get stuff in each port and they would not need to change currencies (at least for these kind of supplies ;-). All they had to do was to make sure they took their allowance of each permitted product.
Besides, even if they'd drink up their wages, the quartermaster would still be assured that they'd have received basic commodities from the chandler's stores.
The structure of the actual financial arrangements was such that chandlers were naturally drawn into extending the range of offered items to whatever ships and individual seamen actually needed, much beyond the initial speciality of candle making.
This is why the profession of chandler gradually shifted from just candle and soap making to that of one stop shops for merchant ships in the 18th and 19th century.
In the wake of previous centuries' English naval supremacy one might say.
Here is an excerpt of the Wikipedia chandlery article:
They supply the crew's food, ships
maintenance supplies, cleaning
compounds, paint, rope, et cetera. The
advantage of a ship's crew using a
chandler is that they do not have to
find stores in the town they have
landed in, nor hold that local
currency - assuming they are let out
of the dock compound by the
immigration authorities. Typically,
the ship owner has a line of credit
with the chandler and is billed for
anything delivered to the crew of his
ship. The chandler is supplied by
merchants local to his location.
Their distinguishing feature is the
high level of service demanded and the
short time required to fill and
deliver their special orders. Because
commercial ships discharge and turn
around quickly, delay is expensive and
the services of a dependable ship
chandler are urgent. Because these
contracts are so lucrative, the
practice developed among ship
chandlers to rebate to ships' officers
approximately 5% of the invoice price
of the ships' stores billed to the
vessel, to encourage repeat
business.