For instance, Bitcoin has a proof of work based consensus algorithm, it's how Bitcoin chooses a node to create the next block in Bitcoin's blockchain. In this way the network is in consensus about the creation of the next block. Part of this block creation process is issuing the next proof of work to the network, and the consensus node, based off of the algorithm in question, may set a new difficulty on the proof of work. Bitcoin tries to keep this proof of work difficult enough but easy enough so that block creation times are around 10 minutes.

What is the algorithm that sets this difficulty?


The difficulty is a function of block creation speed.
The goal is to, on average, create blocks every 10 mins. It is recalculated every two weeks (link)
You can look up the calculation of difficulty in the open source code of Bitcoin

Not the answer you're looking for? Browse other questions tagged or ask your own question.