TL;DR: heating the pan before the oil has no useful effects in most cases.
While this is a duplicate of another question, I'm going to answer it again because that question's accepted answer provides zero evidence or citations to back itself up. Which is important, because the accepted answer is wrong.
The popular myth is "Cold oil in hot pan and food won't stick". Like most such cooking myths, this one is nonsense; as Kitchen Myths points out:
What you really want is “hot pan, hot oil” and that’s what you are actually getting because the cold oil heats up almost instantly when added to the hot pan. You’ll get the same results if you heat the oil along with the pan rather than adding the oil at the last minute. In fact some cooks prefer this technique because the appearance of the oil in the pan can give you some indication of when the pan has reached the proper temperature.
Serious Eats says the same thing:
The thing is, only raw proteins will form this bond. Heat causes proteins to fold in on themselves, or even to break down and form all new compounds. Once in their folded or rearranged form, they no longer stick. So the goal is to get the meat to cook before it even comes into contact with the metal by heating oil hot enough that it can cook the meat in the time it takes for it to pass from the air, through the film of oil, and into the pan.
So, you want a hot pan with hot oil. Most of the time, this means that you want to preheat the oil with the pan, not add oil to a preheated pan, although the latter doesn't do any harm. It just doesn't provide any benefit.
You'll notice I said most of the time, though. There are times when you do want to preheat the cooking vessel before adding fat, and both of those times have to do with needing to heat the metal hotter than the smoke point of the oil you are using.
- If you are cooking with a wok, getting proper "wok hei" (searing) requires heating the wok above the smoke point of vegetable oil, dry, a technique called "long yao" (video, skip to 3:22). Classic cast-iron steak cooking uses a similar technique, heating the pan to 250 °C/500 °F before adding the oil or meat.
- When cooking with butter as your fat (or a few other low-temperature oils like unrefined coconut oil), the burning point of the fat is sometimes a lower temperature than you want to cook at. If so, the only way to get the pan hot enough is to preheat at dry plan, add the butter or fat, and then quickly add the food before the butter burns.
Neither of these cases has anything to do with preventing sticking, though. They are both about not burning the cooking fat. And the first technique only makes sense if you are using cast iron or carbon steel; it can damage other types of cookware.
You might ask: doesn't this apply to cooking sofrito, though? And the answer is no. Filtered olive oil has a smoke point of 210 °C, which is plenty hot enough for the very wet ingredients in a sofrito, which will drag the real pan temperature down to 105 °C or so in a few seconds anyway. Further, a sofrito is made up entirely of non-starchy vegetables and aromatics, which means that sticking isn't a serious concern.
So, myth busted!