I recently saw the famous Sharpe TV series and it portrays as widely accepted the fact that soldier's families lived inside military camps and travelled with the army for the duration of the campaign. How accurate is this ?
Firstly, it really depends on when, where, and who you ask. Trends for military service varied wildly depending on location, nationality, and the activity of the army. A force, during peacetime, which might garrison a city or occupy a small border fortress would have radically different rules when compared to any army on the verge of battle.
But generally, families, wives, and children did sometimes follow the army during active military operations. However, it wasnt as normals as is portrayed in Hollywood, and it wasnt ubiquitous. Some mercenaries, like Martin Guerre left their home and their family to wage war. His wife remained behind while he sought employment in the army. Especially during the 17th century, this was fairly common. Soldiers, especially the common sort, would often leave home to look for mercenary work during periods of war and economic privation. They usually left their wives and children behind to await the soldiers return.
However, there are also examples of soldiers, especially officers, bringing their wives, children, and mistresses along with them during campaign. They would live in the camp (with other members of their social class, obviously), and perform the much needed work for the camp. Women could be found cooking, cleaning, making clothes, foraging, and doing much of the peripheral work for the soldiers.
However, these women were not always the wives, daughters, and mistresses of the soldiers of officers. Commonly, they were themselves vagrants, who sought to make a living in the military camps. They (along with men) would buy and sell items the soldiers needed, provide necessary services (again, as a seamstress, a cleaner, or other jobs), and provide "comfort" to the soldiers. This larger group of "camp followers" was nearly ubiquitous during the period in question, and it was arguably critical in maintaining and supporting the non-military needs of an army.
However, these camp followers were not always appreciated, especially by the commanders of an army. Firstly, they drained the supplies of the army (which were already hard to find), eating food, wearing horses, using cloth, and generally living inside of an army which may already be facing logistical difficulties. Further, the sutlers (merchants), "comfort" women, and other undesirables were very predatory. They would often overcharge soldiers, steal supplies, and generally try to make a profit off the perceived suffering of the army. The women usually transmitted disease, and they introduced a seedy black market into an army that was already composed of societies most undesirable members.
Life in an army camp, especially for women, was rough and course, and so it only attracted a certain sort of person. Somebody who was on the ropes, with nowhere else to go. Somebody who was willing to do hard, and often times morally questionable (or reprehensible) work to make money. Generally, and this is especially true of common women, the army was a place of last resort. Even for me, if you could find anywhere else to be, it was probably better (and safer) than following an army on the march.