From Latin 'civilis' (befitting a citizen) — its dual meaning of 'public' and 'polite' reflects Roman civic ideals.
Relating to ordinary citizens and their concerns, as distinct from military or ecclesiastical matters; courteous and polite.
From Latin 'civilis' (of or befitting a citizen, relating to public life and community), an adjective from 'civis' (citizen), from PIE *k̑ei- (to lie, to settle — one who settles in a community). The Latin civic cluster is unusually coherent: 'civis' → 'civitas' (the body of citizens, the city-state, → English 'city') → 'civilis' (civil) → 'civilitas' (civilised behaviour, courtesy) → 'civilizare' (to civilise). A citizen ('civis') is literally 'one who has a settled home' — their civic identity rooted in place. 'Civil' entered Middle English in the late 14th century via Old French, initially in legal and ecclesiastical compounds: 'civil law' (as opposed to canon or criminal), then in the 17th century developing the sense of polite or courteous behaviour — the behaviour
The phrase 'civil war' is technically an oxymoron. 'Civil' derives from 'cīvīlis' (befitting citizens, orderly, polite), so a 'civil war' is literally an 'orderly-citizen war' — a contradiction the Romans recognized. When Romans referred to their own internal conflicts, they used 'bellum cīvīle' (citizen war) with full awareness of the bitter irony: citizens who should treat each other civilly were instead killing one another.