Some of the ingredients you bake with can be made at home if you're a serious hobbyist or just like to have control of the process. You can make bread with a sourdough starter instead of commercial yeast, for example, and mill your own flour or mix your own baking powder. Cornstarch, though, isn't one of those ingredients. It's made through a fairly complex process that doesn't translate well to a home kitchen.
Start With Grain Anatomy
For the refining process to make any sense, you have to understand a bit about how grains work. The most important part of any grain, from the plant's own perspective, is what we call the germ. It's full of oil and vitamins, but fundamentally it's the starting point for a new plant, and everything else about the grain is there to help the germ do its job. The outer husk, for example, is made of tough, oily bran that makes it hard for water to penetrate the seed. That means it'll survive in the ground until spring, when it can sprout. Finally the rest of the grain is made up of a starchy filler called the endosperm, which is a food supply for the new plant. That's the part we mostly eat, and it's where the cornstarch comes from.
Break Down the Walls
The corn that's used for milling starch isn't much like the kind you eat from the cob. The breeds meant for eating fresh have lots of sugars for sweetness, and they're harvested before they mature. The kind meant for milling is starchy rather than sweet, and it's left on the cob until it's stone-hard. Corn in that form isn't easy to work with, so the first step in extracting the starch is just to soak the corn kernels for a day or two in huge vats. This loosens the husks, moistens the rest of the grain and just generally gets the corn ready for the rest of the process.
Separate the Parts
From there the corn goes through a series of screens, designed to separate the grain into its various parts. The hulls and germ are removed to be processed into corn bran and corn oil. The endosperm has a lot of protein as well as starch, and that's separated out for a variety of other uses. What's left is a wet slurry that's made up of water and starch. The water is drained out and replaced with fresh water to wash the starches until they're really pure. Then finally the starch is dried and milled to a fine powder. That's the cornstarch you get from the supermarket.
Make Your Own
If you'd like to make your own starch, because you're limiting your use of industrially refined products or because you want to avoid the use of genetically modified ingredients – most corn grown in the U.S. is genetically modified – a much easier option is potato starch. Start with old-crop russet potatoes, which are the starchiest, and shred them as finely as you can on a box grater or in a food processor. Transfer the potato mush to a mixing bowl, cover it with cold water and stir it for a few minutes.
Line a colander or strainer with cheesecloth and set it over another bowl. Pour your potato slurry through it to remove the solids, which you can cook with. Squeeze out all the moisture you can; then let it sit so the starch can settle. After 20 minutes or so, carefully pour off the liquid. What's left is the potato starch. Dry it in a low oven or a dehydrator. Then powder it in a food processor or spice grinder. You can use the finished starch in much the same way as cornstarch.