The mortise and tenon joint is the traditional joint for high quality work. It has been used for centuries to attach wood and continues to be commonly used by all woodworkers. The mortise and tenon joint provides a large glue surface and great mechanical strength - without question the strongest and most durable method of joining rails and stiles. This is why wooden doors made over a hundred years ago are still in service, in spite of the fact that the glue - if any glue was used - surely failed years ago.
Today there are reliable glues, but earlier users of mortise and tenon joints had to rely on just the tight fit or various methods of using edges and pegs to keep the joints tight, either alone or to reinforce the inadequate glue that had to be used.
The mortise is a square or rectangular hole cut into the leg or rail that the part with the tenon is to attach to. The tenon is the narrowed-down end of the rail that goes into this hole.
A 'normal' tenon, also called a blind tenon, does not go all the way through the mortised item. A 'through' tenon does go through the mortised item, and usually stops flush with the far surface.