Today, both free city and free state are pretty much nomenclature, meaning that they pretty much are a name only, comparable to the Commonwealth of Massachusetts, which is also called Commonwealth because it features in their constitution but it has no practical impact on how Massachusetts functions vs. other states of the US that are not a commonwealth. The Free State of Bavaria, Saxony or Thüringen do not differ in their status within the German federal state than Brandenburg or Baden-Württemberg. And what sets apart the Free Cities Hamburg and Bremen is that they are states made up of one (in the case of Bremen two) cities like Berlin.
As has been mentioned in this thread the title of Free City indeed carries over from the HRR: They were cities that were not under the rule of any particular lord and did not owe the Emperor taxes or soldiers (unlike the Reichsstädte, which were under direct tutelage of the Emperor). While both the end of the HRR and the Napoleonic wars ended the existence of most of these free cities (or in the case of Frankfurt, its annexation to Prussia in 1866), the former Hanseatic cities of Hamburg, Bremen and Lübeck remained what can be classified best as city states and as such joined first the Nord German Bund and later the German Empire as sovereign entities.
It's important to understand that Germany, even with a central state arising with the Empire in the 1870s, was still a strongly federal structure in the sense that Wilhelm might have been German Emperor but there still was e.g. the king of Bavaria who enjoyed quite some authority in his lands. When the Empire ended in the German Revolution in 1918/19, most of the state entities that made up Germany under the common constitution (sort of like the states of the United States constitute the federal entity), they became "Free States", meaning republics and not monarchies. Free State as well as "Volksstaat" (people's state), which was also used were distinct social democratic / socialist titles that were used to denote the new form of government that originated with the people. Kurt Eisner when he declared the Munich Soviet Republic also used the term "Free State" for Bavaria.
The Weimar Republic was also a strongly federal state, made up of different constituent states. This was only ended by the Nazis, who got right of the states per se as political entities, keeping them only as administrative entities, and who introduced a strong central state in Germany. With the end of Nazi rule, the Allies did not establish a German central state with one central government. Rather, the first political entities that the Allies allowed in Germany were the federal states. These federal states then formulated one constitution, the Grundgesetz, under whose precepts they joined the German Federal Republic. Hamburg and Bremen e.g. were with the argument of their long history as city states able to establish their sovereignty as federal states within that context while Lübeck gave that up and remained as part of Schleswig-Holstein.
Bavaria also chose the label Free State because when it was re-founded as a political entity by the American occupation in 1945, there still was the discussion if it would become a monarchy. In fact, there even was a party agitating for re-establishing the monarch in Bavaria. While the American occupation forbade said party, in order to quell such aspirations one and for all, a popular referendum was held where the populous voted on anew constitution for the state that explicitly referred to it as a free state rather than a monarchy. It was accepted with over 70% of the popular vote and so the Free State of Bavaria was born as part of the Federal Republic.
A slightly similar process occurred in the early 90s when the former states of the GDR joined the Federal Republic. The Grundgesetz explicitly stated that further states could join the Federal Republic, which was the basis for how the GDR could become part of the FGR legally. The FGR did not annex the former socialist country but rather, the constituent states voted to join the FGR. Within that context to denote the new form of government as "real" republics, both Saxony and Thüringen chose to denote themselves as free states.
In that sense, there is no real difference between German states calling themselves Free States of Free Cities except in the name itself.