I Understand why you need the base and the emitter but what function does the collector serve?
Also what purpose does the capacitor serve?
The current allowed to flow from Collector to Emitter is proportional to the current flowing from base to emitter. It's the basis of how a (NPN) transistor works. https://www.google.com/search?q=how+does+a+transistor+work