The algorithm that generates smooth surfaces is performed in two steps: Subdivision and Averaging.
During the Subdivision step a new vertex is added at the midpoint of each edge and at the centroid of each face. Given a face with n vertices {v1, v2, v3, v4} the centroid is given as (v1 + v2 + ... + vn) / n. Subsequently the vertices are connected to form m quads out of each m-sided polygon.
In the Averaging step the position of each vertex is set to be the sum of the centroids of the faces incident to it divided by the vertex valence, that is the number of edges connected to it.