This has been accomplished for centuries; and in my opinion is best achieved in a two-step process.
First… there is the choice of what type of tenon do you want: an Integral Tenon or Floating. An Integral tenon is a natural extension of the wood itself; that is, of the two mating pieces, one piece has a tenon protruding from it; whereas a Floating tenon joints two mating pieces which both have mortises: the tenon traverses the two pieces. From what I’ve seen, the vast majority of M&T work is now done via Floating tenons.
1) The mortise – a normal router with a straight bit (or a flush-trim bit used inside a template) whose travel is secured in some manner – YouTube has a few hundred videos of individuals making mortising jigs. If you’re going to be doing a lot of woodworking, the Festool Domino system is both foolproof and expensive – well worth the money, though.
The router makes quick work of the mortise… though, you have to make the cut is several passes, usually.
2) The Tenon (Floating tenons, specifically) – these are easier than you might initially expect. Use your table saw to rip a thin piece of scrap wood (make it a tough wood such as maple or oak) – the wood piece should be slightly larger than the mortise(s) in all three dimensions (length, width and thickness); then trim the width on the table saw to slightly more than the width of the mortise; round-over the piece on the router table; sand to the exact thickness – dry-fits are usual practice.
While this sounds like a lot to do, it’s not as time-consuming as it sounds.