Consider the image above, where clustering is not applied. Ten markers are scattered on the map. Some are relatively close together, while others are further apart. If you want to apply the the clustering algorithm to the markers then the markers are passed to the MarkerClusterer as an array.
MarkerClusterer starts at marker A and checks to see if that marker is in the bounds of any existing cluster. Because this is the first marker, there have not been any clusters defined, so the MarkerClusterer creates a new cluster that contains marker A and sets it the clusters center to the same location as the marker. The MarkerClusterer continues the same process for marker B, C and D.
When the MarkerCluster gets to marker E there are two existing clusters and marker E lands in the square bounds of both of them so then the marker determines it's distance from each cluster to find the closest one and then it is added to the closest cluster. A option can also be set on the MarkerClusterer so that it adjusts the position of the cluster to reflect the true average of all the markers that are contained within it.
The MarkerClusterer then moves onto the next marker in the list and repeats the same process until all markers are within a cluster.