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?