Context
Here James is speaking about the justification of our faith before men. (By their fruits you WILL KNOW THEM) , a faith that produces no works is a dead faith . (no fruit)
and that is exactly what James is saying here
Jam 2:18 Yea, a man may say, Thou hast faith, and I have works: shew me thy faith without thy works, and I will shew thee my faith by my works.
Works show our faith
What are the fruits of the demons?
Jam 2:19
Thou believest that there is one God; thou doest well: the devils also believe, and tremble.
They know for sure their is a God (they knew him personally..that takes no faith ..no belief..Yet even knowing for sure of the existence , they produce rotten fruit.
You may want to consider the words of Paul
Eph 2:8 For by grace are ye saved through faith; and that not of yourselves: [it is] the gift of God:
Eph 2:9 Not of works, lest any man should boast.
Eph 2:10 For we are his workmanship, created in Christ Jesus unto good works, which God hath before ordained that we should walk in them.
Rom 3:24 Being justified freely by his grace through the redemption that is in Christ Jesus:
Jhn 5:24 Verily, verily, I say unto you, He that heareth my word, and believeth on him that sent me, hath everlasting life, and shall not come into condemnation; but is passed from death unto life.
Jhn 6:27 Labour not for the meat which perisheth, but for that meat which endureth unto everlasting life, which the Son of man shall give unto you: for him hath God the Father sealed.
Rom 4:5 But to him that worketh not, but believeth on him that justifieth the ungodly, his faith is counted for righteousness.
Rom 10:9 That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved.
Jhn 1:12 But as many as received him, to them gave he power to become the sons of God, [even] to them that believe on his name:
I could go on tonto..But I suspect you get the point