To trust in one's own power instead of God's protection is a sin. David had been trusting God to protect him, but now he counted the men of military age so he could know the strength of his army. (See: [[rc://en/tw/dict/bible/kt/trust]] and [[rc://en/tw/dict/bible/kt/sin]])