How To Create New Vertex or Segment When Extrude Passing or Intersection Other Object or Shape
The easiest way to do it is by Bridging the Edge Loops.

Make two legs for the table:



Create two edge loops on both the legs by Ctrl+R. Make sure that it's perfectly aligned or else you will get a slope. To place the loopcuts perfectly hold down Ctrl while sliding the edge loop. Which will get you this:



Now select the faces as shown and press F3 and type in Bridge edge loops.




There you have it.