how do they make sure the end product has the same look and taste as always?
This is the realm of quality control. It involves such activities as:
developing processes that are as consistent as possible
measuring the product against a standard
identifying and eliminating sources of variation
It's easier to control a single large-scale process in a factory than small processes duplicated at many locations, so as much as possible they'll deliver pre-mixed, pre-measured ingredients to retail locations. Equipment will be standardized and automated at each location. A recipe then becomes very hard to screw up, something like:
Add one sack of standard donut mix, one container of eggs, and one
bucket of water to the mixer. Press the "Mix-2" button. When the mixer
stops, transfer dough to sheeter/former and press the green button...
Disclaimer: I've never worked in a franchise donut shop, and actual recipes may be more or less complicated than the made-up one above. But that's the general idea, and it's deployed widely in manufacturing whether or not the product is food.
You can do some of the same things at home if you want to simplify a recipe that you make frequently.
The easiest way to get started is to measure ingredients by weight (if you don't already). It's a lot faster and easier to make, say, a bread recipe if you can skip the measuring cups and just pour flour into the mixing bowl until you reach the target weight. Repeat with water, yeast, salt, etc. You don't dirty any measuring cups, you'll get more consistent results, and you'll save time.
Another step in that direction is to pre-mix whatever ingredients you can, so that you can make a big batch of mix once in a while and then measure out just one thing instead of four or five each time you make the recipe. Pre-mixing can reduce the shelf life of the ingredients, though, so it's not always idea. If you can't pre-mix, then you can at least pre-measure ingredients, or use measuring tools that are suited to the quantities that you need. For example, if you make bread daily using 24oz. of flour, you might get a 12oz. scoop and pre-measure the salt and instant yeast into small containers. Then your recipe is something like:
Add two scoops of flour, a container of salt, a container of yeast,
and a pint of water to the mixer...
Of course, one of the nice things about home cooking is that it's not exactly the same every time. Who wants to eat the same thing every day?