Specifically in wheat and potato breads, what is the purpose of adding oil or butter to the dough?
I have always assumed it was just for flavor, but I suspect there is some background chemical reasons for adding it.
Breads get their structure from glutens--a type of starch molecule formed by the combination of glutenin with gliaten. Kneading and resting the dough helps the formation of glutens--I assume by shifting glutenin and gliatin molecules around, this increases the odds of bindings occurring.
Oils can bind to glutenin and gliatin and inhibit these reactions, so fats--oils and butter--definitely play a role in the texture control.
It prevents the dough from getting too elastic, which controls texture. This elasticity change would also change the maximum air bubble size. Altering resting times and yeast quantity also change these, but trading off for a different flavor. Oil may play other roles, but these are what I recall reading about off the top of my head. Yes, it does contribute to flavor as well.