APM 2.0 had an onboard GPS and compass as shown below
Then APM 2.5 was released which had an external GPS to allow for more flexibility as to where you can mount the APM and GPS for best signal.
Then APM 2.6 was released which now has an external GPS and compass, as for multirotors in specific, the compass plays quite a big role in good position hold (when you are not moving you only use compass for heading)
As for GPS (or for GPS with compass) its best to mount it with a clear view of the sky (not under carbon fiber plates) But if your frame uses plastic parts, or foam, its ok to mount it under this. But most important is to keep it away from your motors/ESC. And if using telemetry, also mount it at least a couple cm away from that.
You can also use a GPS mount which makes it easy to mount your GPS/Compass away from interference.