One is what the cargo weighs. The other is how much room it takes up. A carrier sells space and it sells payload, and it will charge you on whichever of the two runs out first.
That is the whole idea behind chargeable weight, and it is the single most common surprise on a first invoice. A pallet of insulation panels weighs almost nothing and fills half a container; a pallet of tiles does the opposite. Priced on weight alone, one of those two is being carried for free.