Actually adventured is right on non-operating cash being usually discounted. In general the second company will not be valued at $10bn more than the first.
Would you rather have a $1 in cash and a $9 share in the first company, or a $10 share in the second company where $1 is the cash per share? The second case is more risky so you wouldn't pay the full extra $1 for the second share.
Of course it could also be the case that the spread is larger than $1, if the first company is too short on cash and there is a liquidity risk depressing the valuation.
Not if they're otherwise identical companies, it isn't. There may be reasons to expect a correlation between risk and cash holdings, or something to that effect, but ultimately a share in a company is a share of ownership of that company's assets. If a company didn't become $10B more valuable when given $10B in cash, where exactly did that value disappear to? Value doesn't vanish into thin air simply because it's now owned by a company.
Would you rather have a $1 in cash and a $9 share in the first company, or a $10 share in the second company where $1 is the cash per share? The second case is more risky so you wouldn't pay the full extra $1 for the second share.
Of course it could also be the case that the spread is larger than $1, if the first company is too short on cash and there is a liquidity risk depressing the valuation.