in practice two transistors of BJT or MOSFET can be arrange in such a way to be triggered by two different inputs to make both of them On and off in complimentry basis, ie once you apply a voltage to one transistor input them it will tun on making other to turn off, and vise versa with the other input. so EVEN IF YOU REMOVE THIS INPUT THE CHANGE STILL REMAIN THE SAME. ie: at 0,0 input. here 1,1 is not allowed.
so even after you remove the input it remains on the last state so it can be used as a device to remember what really has hapened to iot last, this is how memories are made.
just try some search and see how memories are made.