Transformer Losses - Mathematical Concepts

Can anyone explain why we are squaring the loss factor in these equations? Looking at the I²R formula at face value that is counter intuitive. The inner workings of this formula for this application are incredibly mysterious. Thanks!