The formula you have stated works on the following way:
We use integral to calculate the area under a given line, that is the voltage function over given time interval from 0 to T. Once the area is calculated if it is divided by one side, we will get the average value. If we divide the area of the voltage with the total time, we will get the average voltage.
(From a curvy line, we get constant line, on the same time interval)
I will add pictures.
Example:
Let us suppose that we want to calculate the average voltage on the signal V= cos t for a given time period from a to b

Therefore we have to integrate the function in the period from a to b, calculating the area under the function 
We then divide the calculated area, with the length b-a and get another length value which is the average value

Then area from the average value and the time interval must be the same as the area under the function line

Another example:
If we want to calculate the average value of the numbers 1,2,3,4,5
We would have to sum all of them and then divide them with 5
We have (1+2+3+4+5)(1/5)=3
In your example you replace the sum 1+2+... with integral and the total number of values with (1/5)=(1/t), then you get the average value which is 3 or Vavg
We can also see that the sum of the values 1+2+3+4+5 are always the the same irrelevant of the position 5+1+2+3+4=15 the same holds true for integration too, because it is the same operation. Given the periodic function 1,2,3,4,5,1,2,3,4,5... we will Always have the same sum over the period of 5 numbers irrelevant of the starting number. So for a given periodic function with a period T, and integrating over the same period T we must always get the same result.
If we try to calculate the infinite sum from 0 to n and start calculating 1+2+3+4+5+1... we will always know the numbers used and divide them with the sum. We must get the average value, because we will have navgsum/n, which is actually only the average value.