The kind of adapter you are referring to is called a wall wart. To quote the article referenced :
One of the major advantages to a wall wart has to do with preventing overheating to both the power source and the device that is receiving the power. Because the wart proper is removed from the equipment that receives the electrical current, it is possible to maintain a proper temperature at both ends of the device. Many models of the wall wart are manufactured with built in thermostats that shut down the unit if a malfunction takes place and the wart begins to overheat.
The wall wart hence hashas to accommodate for all the components needed to the switching and matching and also accommodate for the transformers size which is required to handle and do the switching. The larger the size of the transformer,the the larger and heavier the adapter thus blocking up the surrounding area making it difficult to put in other outlets.
Here are two examples of inbuilt transformers for linear and switching power supplies.
That said its pretty bad design and there are a lot of complaints about how the system was initially designed.