It doesn't. Essentially, you have to make sure that you don't fill up the volume space or else you will overwrite the hidden volume.
So, if my volume size is 100G on a 200G drive, I have 80G of data, If I write another byte, how Truecrypt knows it won't overwrite one byte of the hidden volume ?
It doesn't.
If you write anything to the non-hidden volume while you don't have the hidden volume mounted, you risk overwriting part of the hidden volume.
Now, I got it, You have to mount both the hidden volume and the first level volume to safely write to the first level. Great.