Why is an apostrophe used in the genitive “-’s”?

Solution 1:

The apostrophe came into English in the middle of the sixteenth century as a printer’s mark to indicate missing letters. Its use to indicate possession may in part have arisen from the fact that some, but by no means all, Old English nouns formed their genitive with the ending -es. The genitive of scip (‘ship’), for example, was scipes (‘of a ship’), and the apostrophe would have allowed printers to show shipes as ship’s. (By contrast, the genitive of nama ('name') was naman).

It’s probably more helpful to see the development of the apostrophe to indicate possession more generally as an arbitrary convention. That is certainly the case with the use of the terminal apostrophe, as in ships’, which was not established until the eighteenth century.

Solution 2:

According to wikipedia's article the apostrophe is used to mark the loss of the letter e that existed in old English to mark the genitive inflection.

Edit:
Here's an interesting post on this subject: The Possessive Apostrophe His Origin.