Even an expertly prepared cheese sauce separates if it cooks too long. Overexposure to heat -- overcooking -- causes cheese sauce to separate into oil and cheese curds. The keys to preventing this unappetizing problem are preparing the macaroni and cheese sauce individually and using a flour-and-milk base for the sauce, which can withstand the high heat of the oven.
Pasta al Dente
Macaroni and cheese should technically be ready to eat, or at least edible, before you put it in the oven. Using uncooked pasta can cause two problems. The cheese sauce separates in the extensive time it takes for the pasta to become tender. And, in the absence of water, the pasta absorbs moisture from the sauce, increasing the likelihood of separation. Boil the pasta until it is al dente, and drain the water from the pasta before assembling the dish.
Roux the Day
The most heat-resistant cheese sauce is a traditional Mornay sauce -- a basic sauce composed of flour, butter, milk and cheese. The cheese starts with a roux: a mixture of melted butter and all-purpose flour. Though margarine works, the sauce is less likely to separate if you use real butter. Whisk the flour and melted butter together over low heat until the roux is thicker than the desired sauce but not as thick as a dough.
Building the Sauce With Bechamel
You complete the white sauce, or bechamel, by whisking milk into the roux until you have a smooth sauce. High-fat milk products, like whole milk and half-and-half, yield creamier sauces that are less likely to separate. Simmer the sauce but make sure it remains creamy and consistent to prevent separation.
Adding the Cheese
For the smoothest texture, grate a block of cheese into the sauce. Sliced, cubed or pre-grated cheese are acceptable, but you must cook them longer to melt them thoroughly. The longer the cheese cooks, the more likely the sauce is to separate. Freshly grated cheese melts fastest, making it the best bet for a stable sauce.
Baking, Quick and Hot
Mix the pasta and sauce together before pouring them in the casserole dish. Add a layer of grated cheese or breadcrumbs to the top of the mixture to create a savory crust on top of the casserole. The crust will act as a slight barrier between the oven’s heat and the delicate cheese sauce. Bake the macaroni and cheese in a 400-degree Fahrenheit oven just long enough to brown the crust, approximately 10 minutes. The dish should otherwise be ready to serve before you bake it. You can also broil the casserole to brown the crust. Remove the casserole from the oven as soon as the topping reaches the desired color -- leaving it in the oven increases the chances of the sauce separating.