How does the Golgi Apparatus perform its function?
This is actually is an awesome story: both how it happens and how it was discovered. This is one of those stories people get Nobel Prize, and this was Günter Blobel who was awarded this highest possible prize for his discovery, which is according to his Nobel prize certificate:


  "for the discovery that proteins have intrinsic signals that govern
  their transport and localization in the cell"


If you watch or read his Nobel prize lecture you will find answers to your question formulated much better than I can do it here. His Nobel lecture was opened with the following words which might already answer you question:


  Imagine a large factory that manufactures thousands of different items
  in millions of copies every hour, that promptly packages and ships
  each of them to waiting customers. Naturally, to avoid chaos, each
  product requires a clearly labeled address tag. Günter Blobel is being
  awarded this year's Nobel Prize in Physiology or Medicine for having
  shown that newly synthesized proteins, analogous to the products
  manufactured in the factory, contain built-in signals, or address
  tags, that direct them to their proper cellular destination.


Still, I recommend you to read (or watch) to the end, there are some interesting points on how it was discovered and what experiments were done to do it.