Bitcoin hashes the block headers through SHA-256(SHA-256(header)) hashing. The result of that hash has to be smaller than the current target, which is commonly represented by difficulty.
Those computations are performed many, many times during mining, so there are some slight optimisations for the process. Namely, the use of midstate. Generally, before the header can be hashed, it needs to be split in half due to the SHA-256 algorithm (which operates on data smaller than the header). Half of that data does not change with iterations over the nonce, so it is useful to calculate the midstate of that half of the hashing to use in the algorithm, saving you some computational time during each check.
Asides from that, there is more complexity to it (ah, the damned endianness and so forth), but this should make things clearer for you.