How does a transistor work?

When talking about semiconductor devices its usual to talk about the direction the mobile charge carriers flow,
not the conventional current direction, so don't think about current flowing from collector to emitter,
think about electrons flowing from emitter, via the base to the collector. For a PNP transistor then
its holes flowing from emitter, via base, to collector. Otherwise the names "emitter" and "collector"
make no sense.

When you look at a circuit as a whole, then use conventional current - its only an accident of history that we
consider electrons "negatively" charged, as the signs for electric charge were agreed upon before the
discovery of cathode rays and the electron.

Back to the transistor operation: the base region is very thin - it needs to be to increase the
chances that a charge carrier diffuses far enough into the base region to wander into the reverse-biased
base-collector junction (thereafter the electric field in that junction can sweep the carriers over to the collector).
Note that in an NPN device the holes from the base are repelled by the collector voltage and all flow to the
emitter, the electrons from the emitter flow to the base and then get a chance to "see" the collector voltage and
be swept through - careful design allows this chance to be 99% or more, This careful design is why the emitter
and collector are not equivalent (the details are important).