Quite a lot of companies can’t. They only notice they have been hacked when the ransomware operators contact them. Nor are they sure that the Chinese or Russians aren’t stealing their company data by having access to their internal network.
And nobody I know takes the trouble to check every day all his accounts on internet to see if somebody changed the password to take over control, which is a good sign of being hacked.