Some forces where left even after the treaty with Naples.
Among other things, the Treaty of Amiens of 1802 stipulated that Great Britain must abandon the island of Malta while France had to evacuate the part of the Kingdom of Naples that it occupied. The British statesmen soon repented of their actions and refused to give up Malta. Consequently, the French army kept its grip on Apulia in the "heel" of Italy with its strategic ports, Taranto, Bari, and Brindisi.[3] The Neapolitan army of King Ferdinand IV numbered only 22,000 soldiers. Fearful that Saint-Cyr's army might invade his domain, the king concluded an agreement with Napoleon to remain neutral during the War of the Third Coalition.[4] The treaty was signed in France on 21 September 1805 by Charles Maurice de Talleyrand-Périgord and Ferdinand's minister Gallo. The accord required that the Kingdom of Naples dismiss all foreign officers from its army and not allow the landing of any foreign troops in its territory. In return, the French agreed to evacuate Apulia. The treaty was ratified in Naples on 3 October.[5]
Notified of the terms of the treaty and its ratification, Saint-Cyr immediately evacuated Apulia and his corps marched north to join Masséna's army in northern Italy. Almost at once, Ferdinand and Queen Maria Carolina reneged on the treaty and treacherously summoned two Coalition expeditionary forces to Naples. Lieutenant General James Henry Craig sailed from Malta with 7,500 British soldiers while General Maurice Lacy of Grodno (1740–1820) led 14,500 Russian troops aboard ship at Corfu.[6] Another authority gave lower numbers, 6,000 in Craig's force and 7,350 in Lacy's corps. The British and Russians landed at Naples on 20 November 1805. By this time, Masséna was in pursuit of Archduke Charles' army. Since Saint-Cyr moved one-third of his command to help besiege the Austrian garrison of Venice, only 10,000 Franco-Italian troops observed the Neapolitan border.
https://en.wikipedia.org/wiki/Invasion_of_Naples_(1806)#Background