How do the armies draw frontlines on the map. Do they just take a bunch of cities occupied by the enemy and draw a line connecting them or is there something I am missing?
It is usually the forward limit of troops or the firward limit of ground that your army controls. In modern warfare it is a far more nebulous concept then in the napoleonic era.
On the Eastern front in particular entire Soviet partisan brigades operated their own headquarters depots behind german lines. (See Star Media Soviet Storm: Soviet Storm. WW2 in the East - The Partisan Movement. Episode 14. StarMedia. Babich-Design - YouTube).
In the Napoleonic era, the front line was the extent of military advance including cavalry patrols, and rarely fit the modern concept of a “line” except when battle was about to be joined. In that sense, “lines on a map” are probably more misleading to modern (post-WW1) audiences because that was the first conflict where the “lines” actually did indicate the physical territory occupied by active combat troops across large areas of land. In places like the Russian front (in both world wars), the “front line” was again more notional than geographically accurate. Even maps for current episodes of WW2 imply much more physical presence and control than really was the case, except in areas of ongoing high-tempo military action (Leningrad and Stalingrad, for example).