One of the best ways to describe a transistor is as an “electronic switch.” They are solid state devices that make up almost everything in our world. This video by Veritasium, which is a bit older, covers how n and p-type transistors actually work.
This complements the Addohms videos on BJTs and MOSFETs, which are more about how to use them.
If you’ve never watched a Veritasium video, do yourself a favor and set aside a few minutes. He’s like the Alton Brown of science.