The idiom the devil is in the details means that mistakes are usually made in the small details of a project. Usually it is a caution to pay attention to avoid failure.
An older, and slightly more common, phrase God is in the detail means that attention paid to small things has big rewards, or that details are important.
The devil version of the idiom is a variation on the God phrase, though the exact origin of both is uncertain.
Below is an ngram comparing the two.