The letter is called "long s" and is an early form of the minuscule (lower case) of a cursive Roman "S." The Roman letter was more tilted to the right, but by the 8th century CE it was being written more upright in the West. The Roman cursive letter was medial, meaning that it most frequently appeared in the middle of words, and less frequently at the end. Greek has a similar system, with σ in the middle of words, and ς at the end of words. For instance, λύσις "lusis" (a loosening, dissolving). Initially, the ƒ does appear at the ends of words (contrary to popular belief). I don't know why it appears where and when it does, and there was often some variation. For instance, see here: "PARADISO" has a medial "S", but here the very similar word is written "paradiƒe." Different regions and time periods, obviously, but I don't know what variables factored in.