global.lua is more for the functions and compat.lua was made to make things compatible. Such as instead of have player:addItem(itemid, count, ...), in compat lua they made it, to make compatible with older scripts which are using doPlayerAddItem(itemid, count, ...)