This phrase means 'it's not that...' or 'it doesn't mean...'. You use it to say something is not completely true. It helps you explain the real situation.
。
It's not necessarily the case that expensive things are good.
、。
It wasn't that I disliked him, but we just didn't talk much.
、。
It's not that I can't cook, it's just that I don't have time.
。、に。
It's not that I don't like him. It's just that I want to focus on my work right now.
。
It's not the case that all the students are in agreement.