yep - most people miss this trick - but choosing a gym that challenges you to better yourself is absolutely vital. And that's not going to be the same for every person - a gym needs to inspire you, but also be a good fit for your personality and work out style, to ensure you'll keep coming back!
The key is to find some place that feels comfortable, but where the average gym goer is at a slightly (but not massively) advanced level compared to you - this way you've got something to shoot for!