As Andrew's answer points out, the 'number of leading zeros' is just a simplification, so I thought I would give an example to more concretely illustrate this:
Block hashes are usually represented in hex format, which utilizes the character set [0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f]. But for simplicity, we can just use a base 10 number set [0,1,2,3,4,5,6,7,8,9], the exact same principles apply.
The block hash is the output of a SHA256 operation, so it is a 256-bit number, which is a very large number. This means the output of the SHA256 operation will be a number in the range of 0 to 2^256. Again though, for simplicity sake we can consider a much smaller number range in our example, so we'll use the range 0 to 1,000,000 instead.
Now, lets imagine that the hash target is ≤500
, thus any otherwise valid block input that gives an output of 0000500
or less would be considered a valid block. Lets also imagine that the hash target changes to be ≤450
for the next difficulty period, making any output of 0000450
or less a valid block.
Notice that these two targets would "require the same number of leading zeros", but a block that hashes to 0000475
would only be valid in the earlier difficulty period, and not the later. This is because the hash target is a specific number, the number of leading zeros is only a simplification/rough proxy for this.