By how much does mac os differ from linux os

I have been using linux for a while now and wanted to ask how much does a linux machine difer from mac os machine because they all seem to be unix based and i was wondering at the same time why some softwares work in linux and not in mac and vice versa
