1590s, "irreligious, lacking reverence for God," from Latin impius "without reverence, irreverent, wicked; undutiful, unpatriotic," from assimilated form of in- "not, opposite of" (see in- (1)) + pius (see pious). Related: Impiously; impiousness.
word-forming element meaning "not, opposite of, without" (also im-, il-, ir- by assimilation of -n- with following consonant, a tendency which began in later Latin), from Latin in- "not," cognate with Greek an-, Old English un-, all from PIE root *ne- "not."
In Old French and Middle English often en-, but most of these forms have not survived in Modern English, and the few that do (enemy, for instance) no longer are felt as negative. The rule of thumb in English has been to use in- with obviously Latin elements, un- with native or nativized ones.
mid-15c., "having or intended to show faith in and reverence for the Supreme Being," from Latin pius "dutiful, devout, conscientious, religious; faithful to kindred; inspired by friendship, prompted by natural affections," perhaps [de Vaan, Klein] related to Latin purus "pure, clean," via a PIE *pu-io- "purifying" (see pure), but the exact development is disputed.
The classical Roman sense of "having or exhibiting due respect and affection for parents and others to whom such is due" is attested in English from 1620s. In the religious sense, sometimes denoting practice under pretense of religion or for good ends (1630s) and in this sense often coupled with fraud (n.). Related: Piously; piousness.
mid-14c., from Old French impieté "impiety, wickedness" (12c.) or directly from Latin impietatem (nominative impietas) "irreverence, ungodliness; disloyalty, treason," noun of quality from impius "irreverent" (see impious).
<a href="https://www.etymonline.com/word/impious">Etymology of impious by etymonline</a>
Harper, D. (n.d.). Etymology of impious. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/impious