That about sums it up. I'll try to explain my point the best I can.
Concerning salvation, we cannot earn salvation by our works. There's only been one person that has lived a sinless life and that's Jesus. Therefore, since we are sinners we can never be "good enough" to earn salvation, that's why it's a gift.
Titus 3:5 he saved us, not because of works done by us in righteousness, but according to his own mercy, by the washing of regeneration and renewal of the Holy Spirit,
As for why works matter. At my current level of understanding, I believe we must be obedient(works) to receive this gift. Not only a one time obedience but continue to live a life as obedient as possible. For example, when we look at this parable, Jesus says everyone "in me". These are individuals who are in Christ but if they do not bear fruit(works), they are cast out of Christ.
Jn. 15:1 “I am the true vine, and my Father is the vinedresser. 2 Every branch in me that does not bear fruit he takes away, and every branch that does bear fruit he prunes, that it may bear more fruit.
So works can't earn salvation but they are necessary to receive salvation and to continue to be saved. Hope that makes sense.