I sure think it does, but much like picking a "perfect" set of car tires, every shoe is a set of tradeoffs. And unlike tires, there's no decent system for rating sole performance, much less comparing among shoes (and especially across brands).
Lug size and shape do make a difference, as does the rubber itself. Rubber's "stickiness" affects grip on smooth dry surfaces, like rock slab. How well it does in the wet depends on how hydrophilic the rubber is. Tread that works well in sand and dry dirt may be awful in mud, and I sure can't tell in the store.
What I hate more than anything is heading down a steep slab and having my shoes suddenly lose their grip. I've fired more than one pair of trail sneakers that did this to me. Likewise, grip can become scarce hiking up steep, loose trials. The first is due to rubber that's too hard, the second is due to soles lacking aggressive enough lugging.
OTOH a couple years ago I hiked up Lassen, a trip that included many tricky snow chutes. A sizeable group of Japanese tourists also summited and at least half the women were wearing what looked like stylish jazzercize shoes, complete with gym soles. You can never tell!