Your position in the field during a race is determined by a number of factors: speed, part of the race, team plan, individual role, goals, fitness, trust in others, location of key competitors, and much more. But it is important to also know the most efficient positions in the field, so you can find them when you want to save significant amounts of energy.
I remember seeing a graphic a number of years ago that illustrated the energy savings of various positions in a peloton. It may have been longer ago than I remembered because I couldn't find it or any related articles online (please post a comment if you can). But the illustration and the numbers on reduced aerodynamic drag confirmed what I had experienced all along: not all positions are created equal. Some positions provided over 50% savings in aerodynamic drag.
First, it is good to understand a little bit about aerodynamics (this is very simplified—my apologies to anyone who actually studied aerodynamics or flow). As air hits an object—a pack of riders in this case—the greatest area of pressure (wind resistance) is at the front. We all know this from pulling. But rather than a knife cutting into butter that creates a very narrow path, the path of air flowing around an object creates a rounded shape at the front that later tapers off. You probably know this "bubble and taper" shape of the air flow from the shape of aerodynamic helmets and the tubes of aerodynamic time trail bikes. These shapes are used in equipment to minimize aerodynamic drag.
This bubble and taper effect is important to understand when riding in a pack because it illustrates where and how to move up in the field, as well as why the tail end of the field is a bad place to be if you want to save energy. My crude illustration shows this bubble effect (dotted line) and how the most energy (think: hot zone) is required at the front (left side of image), while the sweet spot is found in the cooler regions.
While it's obvious that riding at the front of a pack requires the most energy, the bubble effect also explains why just a few riders behind the leader the peloton is 6+ riders wide. This bubble effect at the front of the pack creates a wide zone in which riders can gain a drafting advantage. When a race slows down a little, this bubble of reduced aerodynamic is pretty big, so moving up the sides of the group is a relatively easy and efficient maneuver. That's why people do it so often.
Conversely, it is important to note that the bubble is only at the front of the pack and tapers off. If you stay buried in the middle of the field, you always get a great draft. But as you get to the back of the pack, in the line of single-file riders trailing the peloton, you actually start to get less draft. Repeat: further back does not always mean an easier ride—you can sit too far back. Now you might start understanding why developing riders sitting at the back of pack often get dropped: in addition to less fitness, they are also getting less aerodynamic advantage from the draft.
This alternate picture is meant to roughly illustrate how different positions are more or less efficient. Don't go fighting for fifth row based on this example (you may find an equally efficient position further up or back—and you need a prize just for finding "fifth row" in an actual field), but do pay attention to the general pattern.
As with most things in cycling, you have to weigh the advantages and disadvantages in this case, too. The most efficient spot in the field may not be as safe and won't allow you to attack or chase the way a less efficient position will. But in a long road race, it sure can save you a lot of energy so you have more left for the finish.