also: んだ
explanatory/emphatic sentence-ending expression
Adds explanatory, emphatic, or reasoning nuance to a statement. Often used when providing a reason, clarifying a situation, or asserting a fact. The の/ん adds emphasis. In questions, it seeks an explanation. Equivalent to のです in more formal contexts.
See also: のです
どうして遅れたんですか。
Why were you late? (seeking explanation)
お腹が痛いんです。
My stomach hurts (explanatory tone).
彼は学生
He is a student (asserting a fact).
のです is the more formal, written-register counterpart of のだ/んだ, which is used in casual spoken Japanese.
から explicitly states a reason or cause, while のだ adds explanatory or emphatic nuance to a statement without necessarily giving a reason.
Combination of the nominalizer の (or its contracted form ん) and the copula だ. The の nominalizes the preceding clause, and だ asserts it, creating an explanatory or emphatic effect.