This phrase means something is not always true. It shows that things are not so simple. It is like saying 'it's not necessarily that...'
。
Having money doesn't necessarily mean you'll be happy.
、。
Just because they practiced the most, it wasn't necessarily the case that they would win.
。
It's not necessarily the case that you won't succeed if you don't put in the effort.
、。
Just because a place is famous doesn't mean its food is delicious, so it's best to find out for yourself.
で、。
It's decided by law, but that's not to say it's everything, I suppose.