Transmission fluid in antifreeze: what to do?

How does this happen and what can you do to prevent it?