You can read more about Google's Terms of Service for using Google Maps APIs or Google Earth APIs. That should define the legalities of using their data.
The APIs are used by 3rd-party application developers so they can use Google Maps/Earth data in their applications. They can build on top of that, providing additional functionalities. (e.g. Foursquare used to use Google Maps, for their check-in app).
However, there's a limit to how much data a 3rd-party application can use/access for a given period of time. Beyond that limit, 3rd-party application developers have to pay. This is similar to the limit that Twitter has for 3rd-party Twitter clients (like Falcon Pro, which recently reached this limit; thus, not being able to display Twitter feed in their app).