The ordre serré (close order) and the ordre profond (deep order) were two ways of grouping soldiers.
Historically, the ordre serré was the way of assembling soldiers in units during a battle or on the march. It is particular to infantry troops, originating in the Greek phalanx formation. Such grouping of men orientated their arms and their efforts to attack in the same direction and, combined with the hoplites' morale and cohesion (reassured as they were by their comrades' proximity), allowed them to defeat larger but less organised armies (as at the Battle of Marathon).
Grouping men in this way, as well as the use of the pike returned at the Renaissance (Flanders and Swiss mercenaries) to face royal armies with a strong tradition of heavy cavalry (France at the battles of Courtrai and Burgundy at Grandson then Morat). Also, Machiavelli (Discourses on Livy) theorised on the use of long pikes to arm the city militias of the small merchant states of Northern Italy (in some of which the beginnings of a citizen-body were apparent). The ordre serré was also used by all the armies of the Thirty Years' War (notably the German mercenaries) even when they were transformed into composite formations with arquebusiers, such as the Spanish Tercio.
Until the middle of the 19th century, the order and the massed impact of a column in "ordre serré" held the key to victory. The order "Serrez les rangs !" was thus the main order to marching units to give battle to the enemy despite their losses.
Then the development of firearms and cannon made definitive changes to battle formations - from then on, "firepower kills" was the order of the day. It decimated the columns of the Crimean War, the American Civil War and the Franco-Prussian War.
In the 18th century, a fierce debate arose among tacticians, some backing the ordre serré and some backing the ordre profond. Infantry fighting thus based itself on two concepts :
The English preferred the "ordre mince" (thin order) and had even developed salvo firing by sections, which allowed a group of men to (on each volley) create a gap in the opposing formation. Less professional armies used salvoes in line-formation, with three ranks (having one rank fire while the other two reloaded). The losses to each salvo were divided up amongst the mass of the opposing unit, and thus had a less damaging effect on morale than fire by section.
The French armies of the 18th and early 19th centuries placed a significant amount of emphasis on the ordre profond, in part to counter the success of the English and Prussian "ordre mince". The ordre profond was also appealing in that, at least on paper, it would cure the problems with desertion, decisiveness, and systematizing that the French had experienced throughout the 18th century, particularly in the 7 Years War.
The ordre profond, with its roots symbolically in the Roman legion and the Greek phalanx, also had a degree of romantic appeal. Depictions of French soldiers as the hoplites holding pikes rather than muskets were common.
Most important for the development of the ordre profond in 18th century France was the belief in the universal principles of war. Many tacticians believed that warfare could be conducted according to rules as applicable in contemporary society as they were in antiquity. Thus, many writers rejected technological change as a reason to change battlefield tactics, emphasizing the importance of depth and shock over firearms. This belief continued into the 19th century, and arguably beyond 
Different formations arose due to new technologies on the battlefield and new concepts as to their use: