Short answer – they’re good at cooking.
If it’s a dish with peppers added while it’s cooked they’ll taste as they add and only put in the amount they need to get the food to the spice level they want.
If it’s something like stuffed peppers it’s usually a less spicy pepper – like a jalapeno – so the top end of spicyness isn’t too high to eat. I’ve had stuffed peppers that had very little spice.
IIRC, chilis’ heat is dependent (first of course) on genetics, but then growing conditions. The mix of nutrients, water (roughly speaking, dryer grow conditions = hotter), sun/light exposure, etc. If you can keep grow conditions largely consistent, so will your end result. But yea, there is just natural variation from fruit to fruit.
If you go to Chipotle and order the red sauce, you’ll notice that the hotness does vary greatly. I get it every time and sometimes it is too hot for me and I have high tolerance. As others have pointed out, other restaurants use processed food and if you are buying hot sauce in a bottle at the grocery store, it is certainly processed
Short answer: you don’t. Lol you just trust that the suppliers did their job well enough. Also you definitely do taste test the finished batch just to make sure. Green chile is pretty reliable though, it’s down to a pretty good science where I live.
Source: helped run my mom’s New Mexican restaurant for five years
Latest Answers