Android Go is an Android configuration specifically built for low RAM devices.
As stated in the official Android Developer documentation, it employs many optimizations mainly focused on memory management.
Android Go has a particular characteristic of having
ro.config.low_ram set to
build.prop to indicate the low RAM configuration. Apps then can retrieve it by calling
ActivityManager.isLowRamDevice(), while the system can directly call the hidden
ActivityManager.isLowRamDeviceStatic() if they need to modify their behavior, mainly to put some restrictions on features that are considered memory-intensive.
Some system services may be disabled, such as (but not limited to):
According to the commit on Pixel Experience/AOSP.
and many other changes in the system's behavior (that can be browsed on the Android Code Search linked above, under the "Cross references" tab on the bottom).
To answer "why it gets better performance", while there are some optimizations done, it also sacrifices features for performance. This, together with Google's "Go" apps collection that is built specifically to reduce memory and space usage, makes the device runs better compared to running the full-fledged Android.
However, while Android Go also provides Play Store to install 3rd-party apps, note that those apps may not have been optimized for low RAM configuration and might suffer performance worse than when running on mid-end/high-end devices (this is more of an issue of hardware spec than Android Go though).