Every cryptocurrency has the preset average block find time managed by a network. If the number of miners increases, the network hashrate goes up. The effective block find time becomes lower than the preset value. As a result, the network gradually increases its difficulty, that is, the difficulty of a problem that miners are solving. The network will keep increasing it until the block find time reaches the preset value.Same thing when the number of miners decreases. When miners leave, the network hashrate goes down. Miners need more time to find a block. So the network lowers its difficulty, thus making a problem easier to solve. Network Difficulty and Hashrate Explained.
How Are Network Difficulty and Network Hashrate Related?
Difficulty and hashrate are closely related. If you divide network difficulty by network hashrate, you will get the average block find time of a cryptocurrency block.