The principle difference between the two approaches (although the companies might disagree) is that Yahoo! is hosting the maps on the Yahoo! domain and Google is allowing developers to host maps on their own sites.
Why do a maps API? It has a powerful marketing dimension (spreading the product and reinforcing its usage) and it enables the development of all sorts of applications that Google and Yahoo! might not envision themselves. It also helps these companies establish relationships with developers that may later be useful on other projects.
One uncertain area: what if I take Google's maps and start a site that layers advertising on top of them? TBD . . .
SilconBeat points to a tit for tat comparison.