(Shaka ni seppou; “Lecturing the Buddha”)
The foolishness of a person who knows just a little about a field trying to lecture an expert. Like delivering a sermon on Buddhism to the Buddha himself. “Teaching your grandmother to suck eggs.” Yes, really.
This pithy idiom comprises only two nouns and a particle joining them. The first noun is 釈迦 (shaka), Shakyamuni, a.k.a. Gautama Buddha, a.k.a. the original Buddha, and the second is 説法 (seppou), a Buddhist sermon or lecture. The particle joining them is the directional particle に (ni), indicating that the second noun is being directed at the first.
A longer version emphasizes the point by adding 孔子に悟道 (Koushi ni godou), “[explaining] the way of enlightenment to Confucius.” Similar phrases point out the foolishness of teaching swimming to a kappa, tree-climbing to a monkey, and so on.
Keep in mind that while a 釈迦に説法 act is silly and unnecessary, it does at least imply that the explanation being given is correct. The now-common act of overriding an expert in order to deliberately lie about a subject is outside the scope of this phrase – it’s something significantly worse.
Apparently this phrase was first attested in the 『俚言集覧』 (Rigenshuuran), an Edo-era dictionary produced at the very tail end of the 18th century.
(“Chieko-chan wa chuugakusei to wa ie, suugaku wa daigaku nami ni dekiru nda. Omae ga kanojo ni daisuugaku no setsumei wa Shaka ni seppou da, yose yose.”)
[“Chieko may be a junior-high student, but she can do college-level math. You explaining algebra to her is like preaching to the Buddha. Cut it out.”]