In Munich, I have always taken the S-Bahn suburban train, which runs very often, into the main Munich station. There are two different lines running between those points, and if I remember correctly each one has two trains per hour. Returning to the airport, one of the S-Bahn trains splits enroute, and one segment goes on to the airport and the other somewhere else. If you take that one on the return to the airport, make sure you get on the right section of the train.
The Frankfurt airport is on the ICE main line between Cologne and Frankfurt, but there are lines going other places from Frankfurt and you may need to go into the main station in the city to catch one of those anyway. There are both mainline and S-Bahn trains frequently between the airport and the main station.
Both stations are right in the airport complex.
Between the two airports, I have always much preferred Munich, and I find that to be very much true also among the German expats I work with. A year of so ago, there was a long thread on FlyerTalk in response to a travel guidebook series naming the three worst airports in Europe based on a poll among their travel writers. While Frankfurt was not on their list, many on FlyerTalk thought it should have been. One described the Frankfurt airport as ''a cross between a maze and a dungeon''.