A transistor has three legs. A small amount of current/voltage on the "Base" (Gate) controls a large amount of current flowing between the "Collector" and "Emitter" (Drain and Source).
Power supplies (DC-DC converters), radio tuners, and the hum you hear from old transformers. 4. The Diode (The One-Way Valve) Function: To allow current to flow in only one direction.
When you apply voltage, the resistor limits the current. The capacitor fills up slowly. The time it takes to charge is not random; it is precise: [ T = R \times C ]
A resistor is a deliberate obstacle. Inside, carbon or metal film forces electrons to bounce around, converting electrical energy into heat (which is why resistors get hot).