Grafting is an old technique where two plants are joined.
The idea is to take two varieties with different properties (think: strength) and combine them. For fruit trees, that would be:
- a "rootstock" (aka rootsystem, sometimes stem) that ensures stability, good nutrition and determines the final size of the tree (think dwarf, for example) and
- a "scion" (or multiple scions) which builds the branches and determines the type of fruit.
There are various techniques as to what pieces of plants can be transfered, from cutting of the entire top and replacing it to replacing only single buds. Key factor is that the tissues at the graft match to ensure flow of water and nutritiens, e.g. for trees the vascular cambium must meet. This allows even for different scions on one rootstock, like the "family apple" which is basically branches of different apples grafted onto one stem, also solving the problem of having a matchin pollinator in a small garden.
Grafting of soft tissue is quite popular in Europe, common for tomatoes, cucumber and eggplant, for example. Choosing the right understock can drastically increase resistance agaist fungal disease.
You can not produce "Frankenstein" plants by mixing and matching across different plant families, the plants must be closely related. Ideally they are of the same type, but closely related can work, too. The "Ketchup 'n Fries" plant works because tomatoes and potatoes are both members of the nightshade family. Cucumbers can be grafted on pumpkins, apples go on apples, a pear might also go on a quince...
So even if the "Ketchup 'n Fries" plant looks like something from a futuristic genetics lab, it's actually quite safe. I would guess that it needs plenty of nutritients, though, as it is supposed to build a double harvest.