If you had to write out every database change to disk immediately after it's made, the database performance would really suffer. This is particularly true on blocks that you change all the time, which would then be written very often. But, you have to be able to recover if the server crashes before things are written out completely too. Periodic database checkpoints take care of that.
Crash recovery and the buffer cache
Checkpoint processing basics
A checkpoint iterates over every dirty block in the system as of a point in time, writing them out to disk. Then, that information is flushed to permanent storage, via the same mechanisms WAL writes are. Once that's done, if your system crashes, recovery from the crash...