Misuse of Army construction terms has been a bit of a pet peeve of mine for a while, pretty much since the 7th Edition rulebook dropped. With the Decurion Detachment confusing the issue a little more, I finally decided to put this together. Some of it seems obvious, but terms like CAD and Dataslate get confused and misused all the time.
In this article, I'm going to start from the very top and work down in specificity, Take note of my use of capitalization in this article as it is very intentional. Capitalized words are used to call out words that have a specific definition when it comes to the game.
Each player chooses an Army. An Army is a compilation of Units or Detachments.
Unbound Armies are specifically any army composed of entirely random units. This army can never take detachments, but can take formations.
A Battle-forged Army is composed entirely of detachments. Each Detachment in the army is considered completely independent of other Detachments in terms of army selection (with the exception of Allied Detachments, but more on that later).
A Detachment is any set structure of unit types or units. Detachments usually come with Restrictions and Command Benefits unique to models and units taken in that Detachment. Units only gain the bonuses from Command Benefits for their Detachment.
A Formation is a type of Detachment that lists specific sets of units in includes instead of a Force Organizational style Detachment.
A Primary Detachment is any Detachment in the Army (except Allied Detachments) from which the Warlord is selected. The Primary Detachment can be a Formation. The Warlord (and thus, Primary Detachment) are chosen during Army Construction (aka, List Building) so this is not a decision to be made at the table.
A Dataslate or Datasheet (above) is a one page (usually) unit or formation description that provides all information for including that Unit or Formation in your Army. Whether or not something is on a Dataslate or older codex entry is irrelevant to army construction.
Now, to get into some of the specific kinds of Detachments. In the Big Rule Book, there are two types of Detachments, the Combined Arms Detachment (or CAD) and the Allied Detachment. These can both be used in any Battle-forged Army, or can be omitted in favor of Faction specific Detachments or Formations.
A CAD is specifically the Detachment pictured in the BRB. It does not have to be your primary detachment. Units within the CAD gain the Command Benefits of Objective Secured for Troops and the ability to re-roll warlord traits if taken as your Primary Detachment. Note that Detachments like the Mephrit Dynasty Cohort Detachment is not a Necron CAD; they are two completely independent Detachments.
An Allied Detachment is specifically the Detachment pictured in the BRB and can never have the same Faction as your Primary or be your Primary. Take note that a CAD does not have to be the Primary, so if an Army consisted of a Formation from one faction that was the Primary, it could have a CAD and and Allied Detachment from the same faction so long as they are different from the faction in the Formation.
Note, there is a difference between an ally and an Allied Detachment. All detachments are subject to the rules of the Allies Matrix. Just because a second faction is "allied in" to an army does not mean it must take an Allied Detachment.
The Decurion from Codex Necrons is in itself a Detachment. It differs from other basic Detachments in that it does not follow a Force Organization Chart. Instead, it reads a bit like a Formation consisting of other Formations. Otherwise, it follows all rules for Detachments.
I apologize if this got a bit pedantic, but it's important to realize when having an army construction discussion that many of these terms are not interchangeable, but have specific definitions. I hope this helps out, and let me know if you have any army construction questions or confusions.