The word is used in a variety of contexts mainly when it is referring to someone you think of as a friend, as a greeting and as a way of saying thank you. The word is derived from the idea of literally being 'safe' when you are with a person, the idea that you will come to no harm.
He is safe, do not hit him.
Safe for letting me borrow your pencil.
Safe, I will speak to you tomorow.
The words actual source is arguable. It is used to describe something that is good or cool. It is a commonly used slang term in London, but is known to be used in other parts of England. The word can be used in many different contexts.
That song was nang.
That car is nang.
You are nang at football.