Hello Dami,
I figured that out, but, in the monster manual :
- all NPC of medium size have d8 for hit dice, even fighters and wizards (see the archmage, page 342),
- proficiency bonus depends of the challenge rating only (which is not the same as the class level),
- the number of hit dice is not always the same as the numer of levels (the druid, page 346, has 5 HD but is a 4th-level spellcaster)
- the NPC have not all the class features (the same druid has not wild shape, for instance)
And it is the same in official adventures of WotC