Compaction
Soil is made up of three main elements: solid particles, air voids and water voids. Compaction is when an element of outside stress squeezes the air voids from the soil, decreasing its volume and increasing its density. This is often done intentionally, using a method such as a roller or a vibrating instrument. There is also a method called "dynamic compaction," which involves dropping a weight on the soil over and over again. The degree of compaction depends on many different factors: the method used to compact, the amount of water to the amount of air in the soil, the type of soil (silt, clay, sand or something else), and so on.
Consolidation
In contrast, consolidation is the act of squeezing the water voids out of the soil. While this is relatively easy with coarse soils such as sand, it is an expensive and time-consuming process with silts and clays. If the soil being consolidated has never experienced an equivalent outside stress to the one being used for consolidation, it is considered "normally loaded," whereas if it has, it is considered "pre-consolidated." Pre-consolidated soil is preferred for purposes of building foundations. Consolidation is often performed with similar instruments to those used for compaction, only with drains installed to wick the water away from the soil.
Why?
The reason a builder would choose compaction over consolidation (or vice versa) depends entirely on the characteristics of the soil. Drier soils are compacted, wetter soils are consolidated. In general, consolidation is more difficult and time-consuming than compaction, especially when it comes to completely saturated fine-grained soils.