The engine output shaft connects directly to the flywheel. The flywheel is pressed against the clutch plate, which is connected to the transmission on one shaft. The transmission has another shaft that connects to the driveshaft/axles/wheels. Inside the transmission the two shafts - one from the engine, one from the wheels, are mated by gears.
Usually the two main shafts in the transmission (engine shaft and wheel shaft in my incorrect parlance) are coaxial (for torque/inertia reasons) and they are mated by gears on a separate shaft, the "layshaft", but we aren't really concerned with the exact geometry and we'll just talk about the two shafts being connected by "transmision internal bits".
Let's get to the first misconception : disengaging the clutch pedal does NOT disconnect the transmission from the wheels nor does it take the transmission "out of gear". All the clutch does is disconnect the engine from the transmission. Clutch is friction based and can slip if the engine & transmission side are not turning at the same speed.
If the transmission is in gear and the clutch is depressed (disengaged), the engine is disconnected from the transmission, so the wheels will spin the transmission internal bits at the speed they want without resistance.
Inside the transmission you have the shaft from the engine and the shaft from the wheels. Sometimes they are connected using a "layshaft" which carries some gears to mate them together. I'll just refer to this stuff as "transmission internal bits". We conceptually think of the gears "engaging and disengaging" but on all modern transmissions the various gears are constantly meshed, and instead they are connected or disconnected from the shafts using dog clutches and syncromeshes. Let's get into that a bit :
One amusing thing I didn't realize is that the H pattern on your shifter actually directly mechanically moves the gear selection. I always thought that it just sent a signal to the transmission to pick those gears, but no it is directly human powered. On a typical 6-speed H shifter you have 1/2 vertically, 3/4, and 5/6. There are three gear clutches inside the transmission. The three horizontal positions of the shifter each control one of the three clutches. The middle horizontal position on all three is neutral - clutch not engaged. So when you shifter is in neutral, the side-to-side position doesn't matter, all 3 clutches are disengaged. In this state the layshaft (internal transmission gears) does not couple the wheel shaft to the engine shaft.
When you move the shifter up and down on the 1/2 axis, it moves a double-sided clutch plate either up to mesh with the 1st gear or down to mesh with the 2nd gear (in the middle it meshes with neither and that's neutral). When it's fully in 1st or 2nd, it locks those gears to the axle using the dog clutch (a dog clutch is like the bumps on a microwave tray, just some bumps and grooves), and the wheels are locked to the shaft that goes to the flywheel in that gear ratio. In between, when the shifter arm is between a gear selection and neutral, the clutch plate for those gears is only partially engaged. The dog clutch also has a syncromesh on it (just called syncros usually). The syncro is a kind of spiral gear which causes the two parts to spin up to equal speed. Obviously the shaft to the wheels and the shaft to the flywheel can be at different speeds; when they're spinning at different speeds the dog clutch would never engage and just grind and bounce off each other; the syncromesh can slightly engage and cause them to match speeds as you move the lever.
The interesting thing is that your manual action of moving the shift lever in to select the gear is actually applying the force to bring the internal transmission clutch plates together, and as you push it in you are causing the syncromesh to mate and spin the pieces up together. This is totaly separate from your left foot which controls the clutch on the flywheel that mates the engine to the whole transmission. If you shift really hard and fast you put a lot of strain on the syncros to make these parts match up. This is sort of separate from the normal "rev matching" discussion but we'll come back to that.
A key thing that I didn't really think about before is that there are actually 3 spinning parts of the equation. There's the engine, which is the RPM you see on your dash, there's the wheels, which you see on your speedo, and there's the transmission internal bits (layshaft if you like). You have no indicator of the transmission internal bits speed, but you can feel it when they're off. In particular :
neutral, clutch pedal out : trans spins with engine, decoupled from wheels
in gear, clutch pedal in : trans spins with wheels, decoupled from engine
neutral, clutch pedal in : trans connected to nothing, spins down slowly
Let's look at what actually happens when you go through a shift.
1. You're in 1st gear. Everything is locked together. The engine is spinning at a multiplier of the wheels rate based on the gear ratio.
2. You press in the clutch. This disengages the engine from the transmission at the flywheel. The engine is now spinning on its own (with much less resistance) and the transmission is still locked to the wheel speed.
3. You move the shifter downward towards 2nd gear. It will move through the neutral position (middle vertical position) were the internal transmission clutch is not selecting any gear. At this point the transmission internal bits are disconnected from the wheels, and are also still disconnected from the engine because the clutch is in.
4. (optional) At this moment you could now double-clutch. If you let the clutch out now, it will connect the transmission bits to the engine and get them in sync. You can now use the gas pedal to easily spin up the transmission internal bits without the wheels being connected. Then you push the clutch back in and keep moving the shifter down towards 2nd :
5. As you move the shift lever towards 2nd, the syncromesh on the transmission dog clutch starts to engage. This causes the transmission internal bits to spin up to the speed of the wheels (multiplied by the gear ratio). The syncros will grind a bit and get the transmission up to speed, then you finish the lever movement and the dog clutch engages. Now the transmission is spinning with the wheels.
6. Finally you let the clutch pedal out. This engages the engine to the transmission, which is already locked to the wheels. Here you get on the throttle to rev match so that the clutch doesn't grind too much on the engine flywheel.
Note : the "rev match" was only for the engine-transmission clutch, not the clutch (syncros) inside the transmission! If you did this series of steps and skipped the double-clutching, you are just mashing the syncros together without any rev matching for them! To address that you should let out the clutch as you move the lever, so that the engine can start to engage with the transmission, you can use your throttle to spin it up to rev match, and then as you slot in the gear selector the syncros will mesh without too much grinding.
Now check out :
Some interesting conclusions :
1. To get out of gear there is no reason to push in the clutch pedal. Disengaging a gear separates the dog clutches and syncromeshes - it is totally unrelated to the engine clutch at the flywheel. (not quite true : if you don't push in the clutch, selecting neutral slides the parts while they are under load, with the clutch in they move without the engine applying force through them)
2. You also don't strictly need the clutch pedal to get into gear. With the transmission in neutral, all you have to do is modulate the throttle to get the engine RPM to exactly the right spot for the current wheel speed, and then slip the shift lever into gear. The syncros with slip you right into gear if your rev match was good. Obviously this is very hard to do reliably, which is why you use the clutch pedal. Note that this is not really "clutchless gear shifting" - you are still using a clutch which is inside the transmission on the gear selectors, you just aren't using the big friction clutch plate between the engine and the transmission.
3. The feeling of shift "ease" in the shift lever is related to how mushy your syncros are. Low performance commuter cars usually have very soft forgiving syncros. I guess these are made of brass or something like that, they are designed to absorb the strain of different rotation speeds and let you slop around the shifter. High performance cars usually have very stiff syncros (traditionally made of steel as in the Porsche but I know newer cars like the BMW M3 are using carbon fiber syncros now). This causes more resistance when moving the shift lever to select gears - even with the clutch pedal fully in. You should shift slowly and firmly, and you can also use double clutching to get the transmission internal bits up to the right speed so that the syncros match. Porsche has "balk" type syncros for 1st and 2nd gear, which means rather than let you slot them together with a bad speed match and grind you up to speed, they just lock you out.
A nice article : Phil Ethier On shifting
I'll fill in a few cracks. The engine shaft that the pistons turn comes out and is connected to the "flywheel". This is just a big disk, which the clutch plate then presses against. You will often hear modders talk about going to a "light weight fly wheel". The weight of the flywheel is useful because it holds some rotational inertia from the engine RPM's, so when you let the clutch out to mate the engine with the wheel speed, the engine is not immediately jerked to the speed of the wheels. (this is a particularly bad problem when starting from a stop, since the wheels are not moving and you would stall your engine). A light weight fly wheel lets the engine spin up faster. It does not increase peak horsepower, since at that point everything is spinning at full speed, but it makes it faster to get to peak horsepower from a stop. It lets you change the engine RPM much faster when the clutch is not engaged, since then the only resistance is the flywheel. When the whole drivetrain is engaged, I can't imagine that the flywheel is a very significant part of the resistance or rotating weight (transmission and wheel weight and everything are much greater). See : on flywheels and YouTube - 3D animation of dual mass flywheel .
Oh, another thing that people like to do is go to a "short shifter". Recall the shift lever is a direct mechanical connection to the gear selectors, when you move it up down, that moves the selectors back and forth, through a mechanical linkage (either cables or rigid arms). A short shifter just moves the mechanical pivot on the shift lever to give you more mechanical advantage, so that a smaller movement of the shifter arm produces the same amount of movement of the gear selector in the transmission. Note that there do exist badly designed 3rd party short shifters which do not do this right, and they will screw up your syncros.
ADDENDUM : let's go a bit further now and understand some fancy new technology.
First of all, the "Sequential Manual Transmission". There are two big differences with an SMT : 1. linear lever operation, and 2. no clutch pedal.
The first thing to understand is that the internal workings of an SMT are exactly the same as a normal MT. You have the clutch, syncros, gear selectors, etc. all the same.
The linear lever operation is accomplished by making the linear motion perform a ratched rotation of a drum. When you push forward it turns the drum one way, when you pull back it turns the drum the other way. The drum has grooves which fit to the gear selectors. The gear selectors are just like in a normal MT - 1st/2nd 3rd/4th kind of thing, it causes them to move back and forth against the sycros and dog clutches. See : here .
The next thing is clutchless operation. This is very simple in fact. They just use the same linear lever pull to engage and disengage the clutch. As you push forward the clutch is disengaged, the lever motion then also selects the gear, and as the lever finishes its movement the clutch is engaged again. A standard manual SMT just does this directly mechanically by hooking up the lever to the clutch; there are also electronic ones that use the lever to control a computer that moves the clutch (it's not an electronic motor to move dry clutches in this case, but rather hydraulic pressure to control wet clutches, but it's the same deal).
Now that we understand an SMT we can move to the new DCT (Dual Clutch Transmission). A DCT is very similar to an SMT. As usual I was a little confused about how a DCT works exactly because of silly commentators describing it in confusing ways, saying there are two gearboxes and the computer selects between them.
This is the best simple schematic diagram . There is still one flywheel being driven by the engine, and there is still just one drive shaft going to the wheels. Between them is the transmission. There are now two "layshafts". (the two layshafts are usually co-linear and share an axle so it's not evident that they are two separate shafts, but they are there). The two layshafts are both connected to the wheels by gears, so when their gear selectors are engaged they being spun with the wheels (multiplied by the gear ratio). The layshafts have gear selectors on them just like a normal SMT - the gear selector can be in the middle (neutral) engaging no gear, it can move back and forth linearly to select one or another gear, meshing through a syncro and then locking a dog clutch to engage that gear.
The two layshafts are then mated to the engine drive flywheel through two different clutches. The two clutches are concentric. Rather than a big disk clutch as in a normal MT, they are concentric rings so they both have some access to the surface area of the flywheel. If clutch 1 is pressed to the flywheel, the engine spins layshaft 1 through the gear selected on layshaft 1, and layshaft 2 is then spun by the wheels through its gear selection, and not connected to the engine, so its clutch plate will be spinning at a very different speed (but not engaged). While clutch 1 is engaged, layshaft 2 can easily select different gears by moving its gear selectors. Its gears are not connected to the engine, so this is just like you moving the stick around in a manual transmision with the clutch pedal depressed - the gear selector will mesh through the syncros and spin up the internal transmission bits (layshaft 2) to match the wheel speed.
With layshaft 2 in some gear, the DCT can then just disengage clutch 1 and engage clutch 2. There is still a tiny transision time, and the engine has to very quickly adjust RPM's to match the different spinning speed of the new clutch. The DCT does not magically take steps out of a gear shift, it just changes the order. Instead of :
disengage clutch, move gear selector, engage clutch
It does : move gear selector on idle shaft, disengage clutch 1, engage clutch 2.
So the time to move the gear selector is hidden.