If something is necessary, it is very important, otherwise something will be impossible, or it will not work as it should do. The opposite is unnecessary.

Something that is necessary is a necessity. The "bare necessities of life" are things like food, clothes and shelter (things you need to keep alive).