The Neapolitan chord (N or bII) was explained on this blog long time ago. It is an interesting topic because of the multiple explanations. According some musicians, this chord is a chord built on the lowered second degree, thus you should considered it as an altered chord. Others think this is a sort of a borrowed chord from the Phrygian mode. The well-known theorist Manfred Bukofzer (Music in the Baroque Era) tackles this chord as a case of mixture. If so, maybe we should think that modes did not disappear at all during the common practice.
From a functional point of view, the Neapolitan chord has to do with the subdominant as it is used in first inversion above all (the IV degree in the bass is an important factor for this interpretation). Nevertheless you can find lots of examples of this in root position, even in second inversion. This chord usually precedes the V (dominant).
Here you are some examples of its academic use. As any topic, there are lots of irregularities and exceptions. We will treat with them at the right time.
Nowadays musicians use this colorful chord even in styles different from classical music. Listen to the following song “Psychodrama” from 4’53”. The harmonic progression (in b minor) is C (N) – b – c#dim – F#. The C chord is in root position.