What causes curdling?

What causes curdling?

“Um, excuse me sir. I think this half and half is bad. It is curdling in my coffee.” Bad half and half or dairy is a logical deduction. I once thought this was the only reason too. Therefore, I would throw out every ounce of what I perceived to be bad...