Penetrating to the division of soul and spirit, both of joints and marrow.

But it also goes on to say that it is a discerner of the thoughts and intents of the heart.

Thoughts refers to what we deliberate in our heart and intents has reference to our motives.

Thus the Word of God is able to discern both what we think and what motivates the thinking.