The basic structural unit for building Japanese words is the syllable. Traditionally, Japanese has 51 syllables (although some are considered obsolete), 50 of which follow the pattern consonant + vowel. (Note that the consonant can be null and the vowel can be short or long.)

But there is one exception: the syllabic nasal N (/n~/ in IPA/ASCII), a sound which does not exist in English. The syllabic N is pronounced as its own syllable (ie. its length is one mora), even if followed by a vowel. The difference in pronunciation is subtle but important in some contexts. For romanized Japanese, if the syllabic N is non-final and is not followed by a consonant, an apostrophe is postfixed, like so:

kinen -- "memorial", no syllabic N: ki/ne/n, 3 mora
kin'en -- "no smoking", syllabic N: ki/n/e/n, 4 mora
kinnen -- "recent years", syllabic N: ki/n/ne/n, 4 mora

In addition, the syllabic N undergoes phonemic changes in some contexts according to the following rules:

"n'" is pronounced "m" if before P, B, M (eg. sanmai, three sheets)
"n'" assimilates the following consonant and is pronounced "ng" (IPA/ASCII /N/, English sing) if before K, G (eg. ningen, human)

The first rule also presents a problem for transcription: should the pronounced M be recorded instead of the written N? Most sources for the layman do so, but scholarly writings (and word processors) usually follow the original Japanese.

The changes caused by the second rule, however, are (almost) never shown in writing.