The models that make up your Warhammer army must be organised into 'units'. A unit usually consists of several models that have banded together, but a single, powerful model such as a lone character, a chariot or a Dragon, a war machine and its crew, and so on, are also considered to be a unit.
A unit consists of 1 or more models that are arranged in base contact with each other in formations of squares and rectangles. All models in a unit must face the same direction. In addition, all models in the unit must be arranged in a formation that consists of one or more horizontal lines, called ranks, and a number of vertical lines, called files. This is why we often refer to basic warriors as 'rank and file' troops.
A unit may not have more complete ranks than they have files, e.g. if the unit is 5 models wide, it may at most have complete 5 ranks. The exception to this is if the unit is too wide to pass in between terrain or units; in these situations, the unit may temporary reform into a formation with more ranks than files for as long as it takes to pass the terrain or unit. After this, it must return to a legal formation again as soon as possible. As far as possible there must be the same number of models in each rank. Where this is not possible it must be the rear rank that has fewer models, and models should always be placed as centrally as possible. Once formed into a unit, the models move and fight as a single entity for the rest of the battle.
In some cases, you will see the rules talking about models in 'base contact'. Note that for whatever reason, a model is never considered to be in base contact with itself, only other models.