Why are units squared in area but cubed in volume? In perimeter they are just straight units.

A straight line has only 1 dimension, namely length, so we might measure the length of a line segment to be 12 cm

(the cm is really cm^1 )

Now take a piece of graph paper. Usually lines are drawn that are at right angles to each other at certain intervals. Suppose they are each 1 cm apart. They form little "squares" that are 1 cm wide and 1 cm wide
We define area as the product of these two dimensions
so if we mark 12 cm one way and 12 cm the other way, we can count 144 little squares.
that is, we multiplied 12cm by 12cm
and got 12x12xcmxcm = 144 (cm)^2 , just like (x)(x) = x^2

Now consider a box of 12cm wide, 12cm long and 12cm high
Remember the little sugar cubes they used to have ? They were approximately 1 cm by 1 cm by 1 cm, or we could say they had a "volume" of (1cm)(1cm)(1cm) = 1 (cm)^3

Now visualize filling our box with those sugar cubes.
The bottom layer would consist of 144 sugar cubes
A second layer would be another 144 sugar cubes,
etc until we had 12 layers of 144 sugar cubes
So the volume would be (12cm)(12cm)(12cm)
= (12^3)(cm)^3
= 1728 cm^3

so in summary:
unit^1 --- would be a linear measurement of one dimension
unit^2 -- would be a "square" measurement in two dimensions
unit^3 -- would be a "cubic" measurement of something that has three dimensions.
...

now here is a thought! What would be a "something" that is measured in unit^4 ???