Legal means allowed by the law. Perfectly legal, legal advice, the legal age.
It has two jobs that are easily confused: legal can mean permitted — it is legal to do that — or simply relating to law, as in legal advice and legal costs. Lawful is the older word for the first sense. Note illegal, which is the opposite of the first sense only; legal tender; and that legal, loyal and leal are the same Latin word arriving three ways.
1adjectivelegalAllowed by the law.
“Is it legal to park here at night?”
2adjectiverelatingRelating to the law.
“She works in the legal department of a big bank.”
Too few real examples of this word to estimate which sense is commonest.
legal is a quality relating to law.
Also accepted in games: lawful
Latin legalis comes from lex, law. Loyal came through French and leal through Scots, so all three are the same word about law.
Latin
lēgālis — legal
English, today
legal
Built from
Learned borrowing from Latin lēgālis (“legal”). Latin lēgālis (“legal”), from lēx (“law”). a doublet of loyal and leal.
Etymology from Wiktionary, CC BY-SA