a good example of such is say hmmmm you have a table top, and the table top is a rectangle, the table is say 3 meters by 2 meters, now meters are just length unit, so the unit is just expressing one dimensional unit.
now, if we want to know the area of the table top, it will be using two dimensional units, namely width * length, so two units go into the result.
what is the area of the table top? well, is a 3x2 meters, so is a 6 metersĀ².
the meters got squared, indicating the resulting vaue is encapsulating two dimensional units, width and length in this case.
likewise, when doing volume, say a box of 3x2x5 meters, has height, width and length, so it's volume is 30 metersĀ³, indicating is encapsulating three dimensional units.