Much of the cash is offshore because it is earned overseas, but businesses use various tax code laws to assign cash to overseas operations, thereby avoiding paying US taxes on it until they decide to spend it onshore.