The difference between a merger and a hostile takeover has to do with the manner in which two companies merge to become a single legal entity and the opinions of the corporate directors involved.
In a merger, two or more companies, usually of similar size, combine to go forward in business as a single company. This may be beneficial if both companies sell similar products and decide it will be better to work together than in competition, or if the businesses complement each other. One company, known as the surviving company, acquires the shares and assets of another with the approval of said company's directors and shareholders. The other ceases to exist as an independent legal entity. Shareholders in the disappearing company are given shares in the surviving company.
However, in a hostile takeover, the target company's directors do not agree with the acquiring company's directors. In such a case, the acquiring company can offer to pay target company shareholders for their shares in what is known as a tender offer. If enough shares are purchased, the acquiring company can then approve a merger or simply appoint its own directors and officers who run the target company as a subsidiary.
Hostile takeover can also be achieved by a proxy fight. The acquiring company obtains authorization from the target company's shareholders to represent their vote by proxy. With proxy authority, the acquiring company essentially becomes the majority shareholder of the target company, enabling it to approve the merger.