how would they add multiple levels or maps?They don't really add "the maps" to the game. Rather, they give the game the ability to load a map at time. They then have somewhere a small script telling which level is first, and each level has annotations of other levels to follow. So in the C++ code itself probably does not even know about the levels. The scripts might know about the first or for some simple games, they could be whole level lists.
Would they have to input everything manually?In the C++ code you mean?
This is referred as hardcoding and it's well known to be a source of problems. It is only adequate for extremely small datasets. achild above suggests "pacman" to be simple enough to go with manual input and I sort of agree for a single level.
The opinions here are more varied. There has been a time in the past when having your editor was necessary. Right now it's more like an option. People pointing out simple games having editors on their own don't get the point. Those talking about UnrealEd forget Unreal Tech is a large share of the whole game development industry.
Would they have to build their own level/map editor? Could they take a preexisting level/map editor and adapt their game to recognize what another level editor puts out?
Personally I think dedicated editors are done - there are a lot of advantages in allowing an artist to use the editor of his choice and just import the work.