The short answer
The example was borrowed, and Smith admitted it. He chose the pin trade as one in which the division of labour has been very often taken notice of. The eighteen operations follow the great French Encyclopédie. He says he saw a small workshop of ten men himself; it has never been identified.
The famous opening
One workman, Smith says, could scarcely make one pin a day. Divide the work into eighteen operations, and ten men can make thousands. It is the most famous opening in the history of economics, and it is a celebration: the division of labour is what makes a nation rich.
The part nobody quotes
Hundreds of pages later, Smith settles the account. A man who spends his whole life performing a few simple operations generally becomes as stupid and ignorant as it is possible for a human creature to become. In every civilised society that is the condition the labouring poor must fall into, unless government takes some pains to prevent it.
So one book contains both the pin factory and the case against what the pin factory does to the man at the eighteenth operation. Nobody quoting the first is obliged to quote the second, and for two hundred years almost nobody did.
On the money
On 13 March 2007 Smith became the first Scot on a Bank of England note. The twenty-pound note carried his portrait and a pin factory, and stayed in circulation until 30 September 2022.