Facebook provides you the user's list of friends, and each friend's list of mutual friends with the user. From there, we construct the friend graph, and then run our clustering algorithm on it.
You're right about Facebook not providing friends of friends. Supposedly they used to back in the day, but not anymore.