nBits refers to the target. The target is a 256 bit number and inversely proportional to the difficulty.
You can calculate the difficulty from the target with the following formula:
difficulty = difficulty_1_target / current_target
difficulty_1_target represents the target corresponding to the first difficulty on the network which was a 256 bit number with the leading 32 bits set to zero and the rest set to 1. Alternatively, the formula works out to:
difficulty = 2^208 * 65535 / current_target.
Back to blocks:
While we often see the block hash represented as hexadecimal numbers which include the letters from
A–F for the numbers 10-15, block hashes result from SHA256d hashing. The output of SHA256 is a 256 bit number (hence the name). When miners are searching for a valid block, they create a multitude of block candidates. When one of these candidates' hash digests (interpreted as a 256 bit number) is smaller than or equal to the difficulty, the miner has found a valid block.