As a non-native speaker who has worked some tech jobs in Beijing, I can explain some intuition behind the usage of "yao."
Specifically, "yao" is used in any pronunciation of a string of numbers. The reason for this is related to 一 and 七, undoubtedly, but arguably more important is the challenge of differentiating the number of 1's when you have multiple consecutive 1's in a string.
By way of example, when pronouncing 8211134, the three 1's in the middle, when said quickly with the "yi" pronunciation, sound like one elongated "ee" vowel sound in the first tone. This is not useful. Using "yao" makes differentiating 1s easy to hear and you can instantly tell that there is a string of three 1s next to each other.
From the point of view of phonemes, this is necessary because "yi" is the only numerical digit in Chinese that is purely a vowel phoneme. Stringing identical vowel phonemes next to each other makes differentiating between them difficult. All other digits 二三四五六七八九十 either end with some kind of consonant sound differentiable from the initial vowel sound (in the case of 二), or begin with a consonant sound differentiable from the proceeding vowel sound (in the case of the rest). Some repetition of these numbers in strings should help you convince yourself that this is the case.
To build on Aria Ax's answer, the reason "yi" changes its tone in these situations has to do with the tone of the following character. You'll notice that in tones, 4 -> 1 (as in 一封信), 4 -> 3 (一桶), 2 -> 0/5 (一个), 2 -> 4 (一亿). For those versed in melody in music theory, or anybody who sings in general, smooth vocal lines are easier for vocal cords than jumpy disconnected ones. The pronunciation conventions for 一 are likely to be inspired by this -- you'll notice that the modification of the tone for the initial 一 makes the pronunciation of the following character's tone much smoother and easier.