Latin dimidius, half.
Words in demi‑ have come into English through French and many examples retain a strong French flavour. It is found especially in subject areas that contain much vocabulary derived from French, such as heraldry, fortifications, armour, and costume. It is not a living prefix, its role having almost entirely been taken over by semi‑.
In many terms, the prefix means either a half, or something of lesser or reduced size: demilune (French, literally 'half-moon'), a crescent or half-circle, or a thing of this shape; demitasse (French, literally 'half-cup'), a small coffee cup; demisemiquaver, in British music notation, a note having the time value of half a semiquaver, a thirty-second note; demi-pension (French, literally 'half board'), hotel accommodation with bed, breakfast, and one main meal per day.
In others, demi‑ suggests something of a lesser degree: demigod, a being with partial or lesser divine status; demi-monde (French, literally 'half-world'), in 19th-century France, the class of women considered to be of doubtful social standing and morality.
However, demiurge, a being responsible for the creation of the universe, derives from Greek dēmios, public; demijohn, for the container, is probably from French dame-jeanne 'Lady Jane'.