"I am looking to purchase a bicycle that needs to hold up under moderate commuting and light trail conditions."
>> Make sure your choice has mounts for a rack and fenders.
"I am looking to spend no more than $300-$400."
>> That price range will put you in an entry level bike at your LBS. There won't be a lot of choices in that range, but any less and you'll need to go with a used bike. There's not much wiggle room at this range, so don't expect a sweet discount or freebies. And don't do the xmart bike thing.
"...how do I evaluate the quality of parts?"
>> Simple answer...ask the staff where the parts rank. Typically, component mfrs offer their products in different levels of quality at different price points.
"...what exactly makes one brand better than another?"
>> There can be differences in warranty, customer support, design, and reputation. For the most part, it's the component selection that makes one offering better than another. Stepping up to the next level bike can equate to higher quality wheels, drivetrain, brakes, etc. The LBS staff will explain this to you.
What really matters is how well the bike fits you and how well it will serve your needs. If your commute is lengthy or you'll be riding harder at times, spending a bit more to get something with higher quality components can mean a more reliable and more enjoyable riding experience. For a geared commuter bike, I'd personally want nothing less than Deore derailleurs & shifters. I'd also avoid cheap or off-brand brakes (like promax). Riding in traffic requires good braking performance.
If you find a bike that is reasonably priced but suffers from a cheap derailleur or brakeset, discuss this with the LBS. For a relatively small upcharge, you could have the inferior parts replaced for quality components at the time of purchase. This is wiser than riding the bike for several months and then resorting to make the upgrades at full price.
And check that the saddle is comfortable. If you haven't been riding, you'll be a bit uncomfortable initially anyhow. But if you have a good feeling that the saddle won't work for you, get it switched out at the time of purchase. Mfrs know we all have different bums with different needs, so they just compromise by spec'ing a saddle that might work for many/most people...but certainly not all.
If the LBS is agreeable to making these changes, feel confident doing business with them. At your budget, it's not possible to get "ripped off," but it is possible to waste your money on a bike that won't suit your needs or doesn't fit you or your style of riding.
Good luck on your purchase and your commuting.