日本語 １３２ 「ん です」as the Explanatory Mode

V or Adj in the plain form (affirmative or negative) + ん です = is colloquial for the の です form.

Since we add these to
Verbs and Adjectives—either affirmative or negative—we are
“Extending the Predicate," the basic function of which is to appeal to the assumed
common understanding or knowledge shared between the speaker and the
listener.Even if the common
knowledge does not exist, it describes the knowledge as if it were shared hence
encouraging a sense of emotional rapport.

More specifically,
there are at least three related but distinct functions of this form of
extended predicate:

1.To signal that what precedes the のだ offers the reason or cause related to the issue
at hand.

2.To emphasize what precedes のだ .

3.To present the request in a milder tone.Hence it can be considered friendly and
colloquial.(from Senko Maynard, An
Introduction to Japanese Grammar and Communication Strategies pp. 236-237.

To this we can add
what our textbook offers, i.e., that it is used to register surprise and also to
ask for and to give EXPLANATIONS.

Hence it is often used with "Why" questions, e.g.

どうして いかないん ですか。

(How come you are not going?)

いそがしいん です。

どうして かわないん ですか。

(How come you won't buy it?)

高いん ですよ！

We also say, by way of explanation X が あるんです＝I have X or there is X

or ask the question 何か あるんですか？＝ Do you have something (to do)? See Nakama p. 312, Activity 2, 3