There are two ways that English indicates the possessive -- with the preposition "of" (A friend of Bob) or with "'s" (Bob's friend). The latter is called the Saxon genitive, because that's the way that Anglo-Saxon (Old English) inflected some nouns to indicate the genitive case. Cyning means king in Old English, and cyniges means the king's or of the king.
English not only kept both possessives but uses them together, which seems somewhat redundant, but which has been around for a long time. You'll find some learned wrangling about how far back the practice goes, but it shows up in The Canterbury Tales ca 1390.
Oon maximus, that was an officer
Of the prefectes, and his corniculer,
One Maximus, who was an officer of the prefect's, and his aide,
This is often called the "double genitive" although The Cambridge Grammar of the English Language will sniff at you for using this term, preferring "oblique genitive" because there is only one possessive sense.
Let's suppose that Tom is the friend and he owns a house. It may be tempting to pile more genitives on a double genitive:
a friend of Bob's house
But this is problematic because the Saxon genitive is attached to a noun, not to a phrase. What you're trying to say is
(a friend of Bob)'s house
You'll likely be understood, but any more and you'll soon lose yourself and your reader (or listener) in the chain of possession. And things only get worse if there are multiple friends and multiple houses. Note that this is not a danger for "of":
The perfume of the flowers of the garden of the house of a friend of
The double possessive finds it use not in extended chains but to resolve an ambiguity. Take the sentence
I took Bob's picture.
Are you a photographer or a thief? For the former, you say
I took a picture of Bob.
If the latter,
I took a picture of Bob's.