The hash of the block must be less than the target (typically represented as having more leading 0's but that is technically incorrect). The block hash is a 256 bit number in hexadecimal form and so is the target. In order to be more difficult, the hash must be less than that target. As the difficulty increases, the target decreases, thus restricting the range of acceptable hashes. As the range decreases, it becomes more difficult to find a hash that matches the criteria.
This should help as well:
https://en.bitcoin.it/wiki/DifficultyI did not ask about difficulty. I asked about block comparison when there is a branch, in other words, when there are two possible block chains.
EDIT: This guy attempted to answer, but not very well.
Block difficulty is determined only by the sum speed of miners working on that chain particular chain, kept track of by evaluating the the spacing of the timestamps of blocks in a 2 week period. It's worthwhile to think about the block chain as a tree that just happens to have a very strong main branch, where branches are weighed by how much work went into creating them rather than their length.
+---> 9 +---> 9
9 +----> 9 |
+---> 1 +---> 1 +---> 1 +---> 1 +---> 1
Here we have two competing tips of the chain, one with a cumulative difficulty of 36 (9+9+9+9, and one with a cumulative difficulty of 25 (9+9+1+1+1+1+1). Although the top section of the fork has less blocks, it has a higher difficulty than the bottom fork and so is regarded as the current "best" side of the chain.