If you have to choose between company A(Quality of Work, Working with more skilled people, Small Company thus job insecurity, working at a location with lesser career opportunities) and company B (Brand name, job security, more probable onsite opportunities, not so sure about getting the work you are really interested in, working at a location with better career opportunities) what would you choose?
I think the real question is - 'Which of these qualities do you value ?'. The personal preferences of the people reading this post will also vary wildly. I for one love building platform / kernel level services that make up the guts of a product. Shaving 5 ms off an API call excites me, but I can understand if it bores other people. My affinities are biased by such choices. Your tastes towards technical and non-technical areas will certainly be different.
One way you can narrow down your question is by taking a look at both companies and asking yourself - 'What is the one thing I would stand to lose if I joined this company ?'. Take the offer that you will not look back on and regret. Of course sometimes you may need to make sacrifices (Fictional Example - money to fund your child's education > Quality of work). It comes down to you.