MGCP/Megaco was developed by the telco community to address the issue of SS7/VoIP integration. The H.323 initiative had grown out of the LAN and had trouble scaling to public network proportions. The architecture that it defined was incompatible with the world of public telephony services, struggling with multiple gateways and the SS7.
To address this problem, the new initiative exploded the gatekeeper model and removed the signaling control from the gateway, putting it in a "media gateway controller" or "softswitch". This device would control multiple "media gateways". This is effectively a decomposition of the gatekeeper to its SS7 equivalents. MGCP/Megaco is the protocol used to communicate between the softswitch and the media gateways.
To confuse terminology: this initiative has come in a number of different guises. Firstly, IPDC (proposed by Level 3, 3Com, Alcatel, Cisco and others) and SGCP (Telcordia) were brought together by the IETF to form MGCP (Media Gateway Control Protocol), under the responsibility of the Megaco (Media Gateway Control) working group. MGCP is, at this stage, a working document and not a standard. The IETF and the ITU have decided to jointly mandate a single standard, endorsed by both communities and known as Megaco (IETF) and H.248 (ITU).
To further confuse matters, existing implementations of this protocol are based on various stages of this initiative; IPDC, SGCP and MGCP form the vast majority of implementations.
Megaco does represent an enhancement of MGCP: it can support thousands of ports on a gateway, multiple gateways and accommodation for connection-oriented media like TDM and ATM.