2 Occupied Germany was a divided country, in 4 parts, US, British, French and Russian (there was no DDR - East Germany - at that time).
Berlin, as the capital, was equally divided into the 4 parts and was disconnected from the rest of non-Russian Germany, totally surrounded by Russian occupied land.
The occupying powers were allowed to fly their national airlines from their various "parts" of Germany to other cities, and especially Berlin. Thus, Pan Am got Frankfurt/Berlin.
I'm not sure of the company structure, but the planes were flown as if they were operating in the US - Pan Am planes and crews, etc.
Same applied to British Airways and Air France, from "their" parts of Germany.
Somehow, I'm not sure how or when, TWA got into the act, also flying Franfurt/Berlin.
When West Germany became "unoccupied" there was still the matter of Berlin, because the Russians (the DDR) wouldn't allow Lufthansa to fly there, unless the West recognized the DDR with Berlin as it's capital.
So Pan Am (and TWA) had an effective license to print money. I flew on both Pan Am and TWA to Berlin several times, the planes were never less than full, and both airlines had a terrible reputation for over-booking.
I was off-loaded at least twice because of over-booking.
But there was no choice.