Who sets the difficulty class test

difficulty-classdnd-5e

I was reading the player's book and in many parts of the book it says

The test is determined by the difficulty of the class

I read it several times and can't understand if the difficulty class is defined by the character's background, or if the DM defines this test and its value.

This was taken from an excerpt from the book

You know Druidic, the secret language of druids. You can speak the language and use it to leave hidden messages. You and others who know this language automatically spot such a message. Others spot the message's presence with a successful DC 15 Wisdom (Perception) check but can't decipher it without magic.

The question is, what is this difficulty class and how is it determined?

Best Answer

The DM decides

Player's Handbook p.174, "Ability Checks":

For every ability check, the DM decides which of the six abilities is relevant to the task at hand and the difficulty of the task, represented by it a Difficulty Class. The more difficult a task, the higher its DC. The Typical Difficulty Classes table shows the most common DCs.

In some instances, the rules may give a specific DC for a specific task. In this case, the difficulty for spotting the presence of a Druidic message is fixed at DC 15. If you have the "Druidic" class ability, you automatically pass this check.