NANG

This is a conjunction.
nang
when, so that

Nagulat ako nang nakita ko sila.
I was shocked when I saw them.

Kumain ka, nang (sa ganoon) ay hindi ka magutom.
Eat, so that you won't go hungry.


The word nang also denotes an adverb or adverbial phrase.
An adverb describes the verb. For example:


Kumain ka.
Eat.

Kumain ka nang marami.
Eat a lot.

Uminom ka.
Drink.

Uminom ka nang kaunti.
Drink a little.

Sila ay tumakbo.
They ran.

Sila ay tumakbo nang mabilis.
They ran fast.


In the past, there was no strict spelling distinction between ng and nang.
 Many Filipinos and especially foreigners still get confused as to when to use each.
Both words are pronounced the same way.  Read about ng.