Custard is a culinary preparation made by blending eggs with milk or cream. Custard is thickened by the coagulation of the egg proteins, which is achieved by gently heating the custard in some way.
"Gently" is the key. That means slowly, at a low temperature, using indirect heat. A double-boiler (like the kind you'd use to melt chocolate or make hollandaise sauce) is useful. Cooking custard too quickly, or at too high a temperature (same thing, really) will cause the egg proteins to curdle.
This means you'll get something with a texture that resembles scrambled eggs, which is not what you want. Scrambled eggs are fine, but custard should be smooth.
Custard is mainly used as a dessert, or as a base for a dessert, or as a dessert sauce. But note: Custard can also be savory. Quiche is an example of a savory custard baked in a pie crust. And believe it or not, a frittata is a savory custard that's cooked directly in a deep skillet.
Custard can be cooked in a bain-marie in the oven, or on the stovetop. Cooking custard in a bain-marie helps keep the cooking air moist and heats gently so that the custard doesn't curdle or crack.
Does that ring any bells? It should. Cheesecake is something that can crack in the oven, which is why you'll often see recipes that recommend baking them with a pan of water in the oven. And as a matter of fact, cheesecake is also a custard.
The combination of eggs and cream shows up everywhere in the culinary arts.
The ratio of eggs to custard can vary, but they all work the same way. Sometimes a starch, such as flour or cornstarch, is added to the custard to stabilize it. When you do this, you don't need as many eggs. Pastry cream (sometimes called creme patissiere), which is used as a filling for classic desserts like cream puffs and éclairs, is made this way.
Custard can also be frozen. Do you know what you get when you freeze custard? That's right, ice cream. Not all ice creams contain eggs, but the best ones do. Not only for richness, but also for smoothness. Adding eggs to the custard helps prevent those little ice crystals from forming when it freezes.