The name "Foggia" might derive from Latin "fovea", meaning "pit", referring to the pits where wheat was stored. The name's etymology remains uncertain however, as it could as well stem from "Phocaea", or most probably from the Medieval Greek word for "fire", which is "fotia", as according to legend the original -11th-c-AD- settlers were peasants, allegedly after having [miraculously] discovered there a panel portraying the Madonna, on which three flames burnt.
The area had been settled since Neolithic times, and later on a Greek colony known as Argos Hippium existed nearby (in Greek, Ἀργόριππα or Ἀργύριπποι).
However the first document attesting the existence of the modern city dates from circa 1000 AD, during the catepanate era of Byzantine sovereignty. The area remained marshy and unhealthy, until Robert Guiscard directed draining the wetland, boosting the economic and social growth of the city. The city was the seat of Henry, Count of Monte Sant'Angelo during the last twenty years of the 11th century. In the 12th century, William II of Sicily built a cathedral here and further enlarged the settlement.
Frederick II had a palace built in Foggia in 1223, in which he often sojourned. It was also seat of his court and a studium, including notable figures such as the mathematician and scholar Michael Scot, but little of it remains now. In 1447, King Alfonso V of Aragon built a Custom Palace to tax the local sheep farmers. This caused a decline of the local economy and the progressive ruin of the land, which again became marshy. In 1456, an earthquake struck Foggia, followed by others in 1534, 1627 and 1731, the last destroying one third of the city. The House of Bourbon promoted a certain economic growth by boosting the cereal agriculture of Capitanata and rebuilding much of the settlement.
In the 19th century, Foggia received a railway station and important public monuments. The citizens also took part in the riots which led to the annexation to Italy in 1861. By 1865, there was a definitive shift from the custom of sheep farming in favour of an agricultural economy.
During World War II, Foggia heavily bombed by the Allied air forces for its important airfields and marshalling yards. After the armistice of Cassibile on 8 September 1943, the town was briefly occupied by German troops in Operation Achse. There was some fighting there during the Allied invasion of Italy. In response to the Allied advance towards them, the German troops occupying Foggia abandoned the city on the 27th of September. By the 1st of October British troops had successfully occupied the city. In order to clear the Germans from the hills north and west of the Fogia plain and to reach the Vinchiaturo-Termoli road near the Biferno River, Britain's General Montgomery sent his British 13th Corps beyond Foggia on a two division drive, the 78th Division (sometimes known as "the Battle Axe division") moved on the coastal road to Termoli and the 1st Canadian Division struck inland through the mountains. 5th Corps followed, protecting the west flank and the rear. The German 1st parachute division had largely withdrawn to the Biferno River near Termoli and dug in. Based out of Foggia, the British launched Operation Devon and succeeded in dislodging the Nazi German forces from Termoli.
The historical lack of water resources was solved with the construction of the
Apulian aqueduct in 1924, when Foggia was already an important hub between northern and southern Italy. On 1 October 1943, the British 8th Army liberated Foggia, making it a stronghold of their slow offensive towards the north of the peninsula. In 1959 and 2006, Foggia received, respectively, the Gold Medal for Civil and Military value for its role in World War II.
The makers of the well-known American TV sitcom All in the Family included in the biography of the main character Archie Bunker a World War II service at Foggia, in the ranks of the United States Army Air Corps.