Bipolar transistor are said to have both electron flow and hole flow. Movement of electrons can be understood, but holes are fixed part of the atomic/crystal structure. How can we characterize their movement?
Holes are spaces where an electron could be but presently is not. Like any hole in the macroscopic world, you can't move one; it's an absence. All you can do is fill the hole, which creates a new hole somewhere else. We can in some ways model this as an imaginary particle that's flowing the opposite direction from the electrons (and thus in the same direction as the current), but there's no actual particle moving in that direction. Like most models, it's a convenient fiction that makes the math easier.
A nice way to think of this is to imagine an inclined ramp with a groove full of marbles down the slope of the ramp. When you remove the bottom marble the stack behind all shift down and a hole appears at the top of the stack.
While it is true that in crystals that the charge carrying mechanism is electrons, holes are more than just a conceptual placeholder. All of the equations work just as well with holes as they do for electrons, you can do the calculations and determine the effective mass of holes and the mobility of holes (which in Si is about ~2.5X slower than electrons). So you shouldn't take the fact that they aren't real as the same as that they don't have real effects.
A BCDEFG ^ here is a hole between two letters
Now watch it "move":
AB CDEFG (Actually, B moved left) ABC DEFG (C moved left) ABCD EFG ABCDE FG ABCDEF G
The holes don't actually move, but it appears that way. When an electron makes a move, one hole closes, and another opens nearby.
Whenever a letter moves one space to the left, a hole also moves one space to the right. We can regard this situation as a movement of letters toward the left, or as a movement of holes toward the right. It is equivalent.
Note that in electronics, current is usually described as a flow of positive charges, from a node at a more positive voltage toward a node at a more negative voltage. This is called conventional current. But the real current actually consist of electrons that go from negative to positive. This reversal doesn't matter because current is just a mathematical abstraction. All the equations describing device behavior work just fine.
Scientists arbitrarily assigned "positive" and "negative" labels to charges, long before the structure of the atom was known. So it only later came to light that the charges which actually move through conductors are the ones that were labelled "negative".
SEMICONDUCTORS, DIODES AND TRANSISTORS
ELECTRONS AND HOLES
Let's think of a row of pennies laid out in a line, touching, across a table. Move the right hand end penny one penny's width to the right, leaving a gap. Then keep moving the penny to the left of the gap into the space. As you proceed all the pennies have moved to the right, and the gap has moved across the table to the left. Now picture the pennies as electrons, and you can see how electrons moving one way across a semiconductor causes holes to move the opposite way.
To stretch the analogy, we could use little piles of pennies, so a lot have to move right before a hole moves left. Or we could have a few pennies and a lot of space so that holes travel easily as the sparse pennies are moved across the wide gaps. These two cases model the two forms of doped Silicon, lot of electrons added and we have N-type, lots of holes (electrons removed) and we have P-type. The types are achieved by mixing (doping) the Silicon with small quantities of other metals.
With the electrons having to struggle through the atoms of a semiconductor, its resistivity is relatively high. Early semiconductors used Germanium, but, except for special cases, nowadays Silicon is the universal choice.
Copper wire can be visualised as having big piles of penny electrons, all close together, so a current is the movement of the few pennies at the tops of the piles, no holes are produced at all. With so many available for the current, resistivity, as we know, is low.
The commonest semiconductor diode (there are other specialised types) has a junction between N-type and P-type. If a voltage is applied to the diode, positive to the N-type end and negative to the other, the electrons are all pulled to the positive end, leaving holes at the negative end. With hardly any electrons in the middle, almost no current can flow. The diode is "reverse biassed"
When the voltage is applied the other way, negative to the N-type end and positive to the P-type, electrons are attracted to the middle and can cross over to cancel out the holes in the P-type, and flow out into the connecting wire. At the other, negative voltage, end, electrons are repelled into the middle of the diode, to be replaced by those flooding in from the wire, so overall a current can flow easily: the diode is forward biassed.
The connections to a diode are called the "Anode" which is the positive end when the diode is forward biassed, and the "Cathode" which is the negative end. I remember these by analogy with the same terms for valves, which need a high positive voltage (H.T. for "High Tension" -- keep your fingers off) at the anode for current to flow. A good mnemonic for the polarity of a forward biassed diode might be PPNN: "Positive, P-type, N-type, Negative".
A varactor diode exploits the fact that two separated charge areas, positive and negative, make a crude capacitor. So, specially designed diodes are made to exploit this, when reversed biassed. The applied voltage pulls the charges apart, forming a "depletion layer" between the contacts. Increasing the applied reverse voltage makes this layer thicker, so reducing the capacity, and vice versa. Varactor diodes are commonly used in tuned circuits to vary the frequency, replacing the vaned capacitors that were used in the days of valves.
A bipolar transistor is one whose operation depends on both electrons and holes. It comprises two diodes back to back sharing a common central layer. One of the outer terminals is the Collector C and the other is the Emitter E. The central connection is the Base B, and it is part of both the CB and BE diodes. So we have a three layered sandwich. In normal use the diode between C and B is reverse biassed, so, without the presence of the BE diode and its effect, no current would flow, because all the electrons are pulled up to one end of the CB section, and the holes to the other end, as in a diode, by the applied voltage.
The BE diode is forward biassed, so a current can flow and the external circuit is set up to limit this to a fairly small value, but there is still a lot of holes and electrons flowing through the Base and Emitter.
Now the clever bit. The common connection of the CB and BE diodes at the Base is made very thin, so the flood of electrons and holes in the BE part replace those that the reverse Collector voltage has pulled away, and a current can now flow though this CB diode in the reverse direction, and then on through the forward biassed BE junction to the Emitter and out into the external circuit.
I think it is obvious that you can't make a transistor by soldering two diodes back to back, the action requires that intimate sharing of the thin layer inside the Silicon.
The Collector current depends on there being a Base current flowing, and the transistor is designed so that a small current in the BE diode opens the way for a much larger current in the CB junction. Thus we have current amplification. Using voltage drops across external resistors, this can be converted into voltage amplification.
These transistors are called "bipolar" because they effectively have two junctions.
I have carefully avoided mentioning the type of material in the CB and BE diodes, the ideas are the same for both, and we can have NPN or PNP as the possible layers. The arrow in the symbol, which shows the direction of the conventional Collector current (the opposite of electron flow), points in the direction of the negative side of the applied CE voltage, so the current is "out of P and into N at the emitter".
FIELD EFFECT TRANSISTOR, or FET
There are lots of different designs of FET, and this is a very simplistic look at their basic principle.
These are "unipolar" transistors, although the term is not often used, because their operation depends only on electrons and electric fields, not holes.
Here we have a single block of doped silicon, the "channel", with lumps of the opposite type on the sides, or as an encircling ring. So we have only one diode junction, which is called the Gate G, between the lumps or ring and the channel. The channel acts as a resistor, with current flowing though from one end, the source S, to the other the Drain D. The junction between gate and channel is reverse biassed, so no current flows, but there is an electric field set up which pulls charges, electrons or holes, to the sides of the channel, leaving less available for the SD current. Thus we have the SD current controlled by the voltage on the gate.
Note this is a voltage controlled device, virtually no current flows into or out of the Gate. Think of Ohm's law: Resistance = Volts/Amps, and we see that a very low current means a very high Resistance, so the FET is said to have a very high input impedance -- its main advantage over Bi-Polar, where, by contrast, it takes little voltage to send the current through the base, giving it a low input impedance