Cost Element is the Cost Carrier in SAP. All the cost (and revenue) flows via Cost Element.
Primary Cost Element vs. Secondary Cost Element
Primary Cost Element are cost carriers between FI and CO. So, when cost needs to flow from FI to CO, it flows via Primary Cost element. Every P&L G/L account where values needs to flow to CO module must also be created as Primary Cost Element.
Secondary Cost Element are cost carriers within CO module. So, when Cost needs to flow within CO module (for example one cost center to another cost center), it is done using Secondary cost element. Secondary cost element has no corresponding G/L account like Primary Cost element.