early 15c., "uncover, lay bare, expose, disclose, reveal," a sense now obsolete, from Latin detectus, past participle of detegere "uncover, expose," figuratively "discover, reveal, disclose," from de "un-, off" (see de-) + tegere "to cover," from PIE root *(s)teg- "to cover."
Sense of "to find out the secret action or character of" is from 1580s. Meaning "discover, find out, ascertain" is from 1756. Related: Detected; detecting.