why do we sometimes show possession/ownership using 's or of, why sometime not?
Neither the Saxon genitive (the family's name), nor "of" (the name of the family), nor noun1 + noun2 (the family name), of themselves, imply possession/ownership.
Saxon genitive shows an association of some sort - the nature of the association will be found in the context, e.g. "John's boss has promoted him."
Here are more examples of how things are associated:
John’s/The man’s horse can mean
The horse that John/the man owns;
The horse that John/the man has borrowed from David so that John’s/the man’s daughter may ride it.
The horse that John/the man is riding, although he does not own it.
The horse on which John/the man has placed a bet.
Old English also had the preposition “of” that was followed by a dative noun. It was not commonly used other than before an adjective + noun combination.
Of is a low-stress version1 of "off" (i.e. "off" in the sense of "away from" and shows an origin of some sort (but not necessarily the primary origin) and is now a synonym of "from" -> "This knife is made of/from steel" "This man is John of Gaunt", i.e. This man is John from Gaunt.
However, all this was complicated in 1066 when the French speaking Normans invaded England and brought with them the French “de” which was translated as “of”, “from” or “off”
Around 1400, in English, the words of and off gained their separate meanings.
1Hence man o' war; John o' Groats
Neither of these are grammatically related to noun1 + noun2 (e.g. family name) in which noun1 acts attributively, although this also creates an association of some sort that should be explained in the context. "This is the Chemistry Department" -> This is the Department associated with [teaching] chemistry. This form goes back to Saxon, which language, like Modern German, was agglutinative, i.e. it adds words together to make new words.
When you should use which version
First, you should understand that there are no rules to help you. There is only broad guidance. Nothing that follows is a rule: (Please read this again, it is important.)
The genitive ‘s’ is used
Where
(i) the subject is capable of having some sort of control over the noun, (John’s/the man’s horse) or
(ii) the subject is associated with the noun in some way, (The man’s boss).
[NB People can have (i) some sort of control over the noun, and (ii) be associated with the noun in some way, so we can always use the genitive ‘s’ with people], or
(iii) the object is an inseparable, and/or natural part of the subject: The tree’s branches; the car’s tyres; the road’s surface.
The “of + noun” is used where
(i) the subject is incapable of having any sort of control over the noun, e.g.
“That is the type of thing that I want.” / *That is the thing’s type that I want.”
(ii) Where the subject is a quantity of the noun e.g. “I want twenty gallons of petrol.” *I want twenty petrol’s gallons.
(iii) Where the subject is a human name and the noun was created by the subject: The plays of Shakespeare / Shakespeare’s plays; The music of Mozart/Mozart’s music; “He is the son of Joe Biden/He is Joe Biden’s son.”
The “of + noun” is NOT used with names if no creation is involved:
*The car of John is fast; *The handbag of Brenda is leather.
Unless, like Old English, the "of" is followed by an adjective:
*The car of older John is fast; *The handbag of beautiful Brenda is leather.
The noun1 + noun2 is used where
The two nouns are independent and equal but linked in some way, e.g. “A shoe shop” – a shop that sells shoes; A news bulletin – a bulletin containing news; information technology – technology that facilitates the transmission of information