A fact is necessary if it could not have failed to be the case. Mathematical facts are often thought to be necessary; it is often thought that the the world could not have been such that, for example, 2+2 did not equal 4.
Facts which are not necessary are contingent.
Sometimes people talk about beings as well as facts being necessary. Typically, what is meant by `necessary being' is `being whose existence is necessary, i.e. a being which could not have failed to exist. Traditionally, God has been thought to be a necessary being.