Why it happens
Proper custard, or crème anglaise, is thickened by egg yolks. As the yolks heat, their proteins slowly set and thicken the milk or cream. If the custard gets too hot, the proteins coagulate too much and tighten into small lumps, which is curdling. This happens quickly, so a custard that is heated too fast or not stirred enough can go from smooth to curdled in moments.