The English possessive isn’t a contraction, but rather a relic of the grammatical case system, so why is an apostrophe used in (most) forms of the possessive?
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.