Curdling happens when the proteins in milk aggregate...
....together due to a change in pH (acidity). In fact, casein was first isolated when a chemist added acid to milk and the protein precipitated out.
that happens because charges that exist in the native protein get neutralized and now the protein molecules have a higher chance of interacting with each other, forming clumps
I am not a food chemist, but I think that once you add other things to the milk like eggs, flour - you are adding a lot of other proteins and chemical compounds that lower the probability of casein reacting with casein, so it stays "soluble"