I've come across this circuit to common pi problem of stepping up 3.3 GPIO to 5V, so it could drive a relay module (Link here). I've one doubt, most circuits online also have a 5V input in the circuit, like so from link here:
Of course my understanding is limited, since I'm a noob when it comes to circuits, how would the first circuit work (how it outputs 5V to relay pin LN1)?
EDIT1: