The dagesh was added to Hebrew orthography at the same time as the Masoretic system of niqqud (vowel points).
Two other diacritics with different functions, the mappiq and the shuruk, are visually identical to the dagesh but are only used with vowel letters.
They each have two sounds, the original hard plosive sound (which originally contained no dagesh as it was the only pronunciation), and a soft fricative version produced as such for speech efficiency because of the position in which the mouth is left immediately after a vowel has been produced.
In Modern Hebrew, however, the dagesh only changes the pronunciation of ב bet, כ kaf, and פ pe.
'strong dot', i.e. 'gemination dagesh', or דגש כפלן, also 'dagesh forte') may be placed in almost any letter, indicating a gemination (doubling) of that consonant in the pronunciation of pre-modern Hebrew.
This gemination is not adhered to in modern Hebrew and is only used in careful pronunciation, such as the reading of scripture in a synagogue service, recitation of biblical or traditional texts or on ceremonial occasions, and only by very precise readers.
The presence of a dagesh ḥazak or consonant-doubling in a word may be entirely morphological, or, as is often the case, is a lengthening to compensate for a deleted consonant.