To better understand this. I would rewrite your code without LINQ as below:
public static class Extend
{
public static double StandardDeviation(this IEnumerable values)
{
double avg = values.Average();
var newValues = new List();
foreach (var v in values)
{
newValues.Add(Math.Pow(v - avg, 2));
}
return Math.Sqrt(newValues.Average());
}
}
Now you can compare these two versions of code and see the relation.