The index of a company's actual value is not determined by its market capitalization but its enterprise value. Let's say that Company A has $300 cash in its assets whereas Company B has a $300 debt without any cash. When acquiring Company A by purchasing the entire outstanding shares with $1000 in cash, the cost will be $700 net of $1000 subtracted by the existing cash portion of $300. Similarly, when acquiring Company B by purchasing the entire outstanding shares, the acquirer takes over the liability of $300 to be repaid on or before the maturity date, resulting in a total cost of $1300.
EV = Market Cap.(Outstanding stocks x Stock market price) + Total debt - Cash or Cash equivalent