Think about how you would divide this premium between the target and the acquirer. It's actually pretty simple, imagine the next best possibility for the target. If there are many acquirers, the target should appropriate most of that value, hence, a high premium. If the next best alternative isn't as good, the acquirer should capture value. It follows logically that the optimal rational bid for a company is slightly more than the value added in their second best alternative (as an aside, this is really close to how IPO pricing works). Companies aren't necessarily rational though, so in competitive acquisitions companies frequently pay more than the actual value added. Empirically, acquirers in single-bidder acquisitions typically see price-appreciation of about 2% in event studies, whereas acquirers in multi-bidder acquisitions typically see price drops of about 1.33% in event studies. This indicates that acquirers in single-bidder acquisitions typically appropriate some of the added value, whereas in multi-bidder acquisitions, the target company captures all of the value added (plus some) by the acquisition.
A really interesting example of this was RJR Nabisco in the 80s. The idea was to separate RJ Reynolds, the tobacco company, and Nabisco, the food company. RJR was a cash machine, but they had a huge uncertain liability from tobacco lawsuits that was depressing the value of the entire company; the separated company was worth a lot more than the company was together. It was trading for about $55/share, then KKR structured a LBO to buy it and break it up, and paid $109/share (management initially bid $75/share for a takeover). In that case, there were many bidders, so the vast majority of the value was appropriated by the shareholders (in fact, KKR didn't generate a good return). [1]
In general, the market cap is the best indicator of the true value of a company in it's current configuration. That does not mean there is not some other configuration or combination where the company could be worth a lot more. It's worth mentioning that whenever the market price is incorrect, there is an arbitrage opportunity available to move the price to its true value. HFT is basically designed to capture these opportunities almost instantly, which is exactly what you would expect if markets are efficient.
1: I highly recommend the 1993 HBO movie Barbarians at the Gate, about this LBO.