I get asked - a LOT - how I join pieces of wood together at structural joints when building furniture. Most people, outside the woodworking/furniture-building world, assume it's some combination of screws, nails, dowel rods, etc. Those people are usually surprised when I tell them that I typically use glued mortise and tenon joints, as have craftsmen for literally thousands of years, and no mechanical fasteners of any kind.
There are an almost infinite number of ways to join pieces of wood together, but the mortise and tenon joint has to be one of, if not the most common type of joint in well-made furniture. So, what does a mortise and tenon joint consist of? Well, a mortise and a tenon. :)
The mortise, which for my money is the more crucial of the two components, is shown in the above picture on the righthand side. It's the hole, or slot, that the tenon fits into. I should mention that the joint being shown in these pictures is not a true mortise and tenon joint but more of a hybrid open mortise bridle-joint (but for all intents and purposes, it's a mortise and tenon joint). That said, most builders prefer to cut the mortise first, as it's easier to shave material off the tenons until a proper fit in the mortise is achieved than it is to cut the mortise exactly right to fit a tenon.
There are a variety of ways to cut mortises, and I prefer to use my router with a spiral bit. I avoid using a jig if I can help it, as jig construction sometimes takes more time than cutting the actual mortises does. I set up the router table, get the fence where I need it, and start blowing through material. I don't worry too much about the bottom (or top) end of the mortise cuts, as I fine-tune those with a chisel. The router cuts circular holes and tenons are usually cut with square corners, and everybody knows you can't put a square peg in a round hole. Hence the chisel work, to square up the mortise bottoms (and/or tops).
With the mortises cut, the tenons, shown in the above picture on the left, can be cut to fit the mortises. In general, it's a good idea to cut the tenons so that there's a hefty amount of material remaining, with just enough shoulder around the tenon to provide a clean edge and structural integrity during clamping. I normally cut tenons on my table saw with a dado blade, and I typically try to cut the tenons as long as I can but it's all relative to the size of the lumber in the joints and the type of project I'm building. Likewise, I think most people - myself included - don't aim for perfection with the first series of cuts. It's easy to continuously remove material, but if too much material is cut off...it's time to start over. The idea is to cut the tenon so that it fits fairly snugly in the mortise, but not so snug that you need to beat it into place. Patience goes a long way in cutting tenons.
At the end of the day, the tenon serves two purposes: 1, to provide strength so that the load carried by the rails of a piece is transferred to the posts (AKA, provide a joint so that the rail can be supported by the post), and 2, to provide as much surface area as possible to which glue can be applied. With the mortises and tenons cut, glue can be applied to all surfaces and the joint can be clamped.
Once the glue dries, it's stronger than the wood it's holding together and, if done correctly, the joint should last for a really, really, really, really long time, and definitely longer than any kind of mechanical fasteners.