When lifting an object, the work done by an external force equals the gravitational potential energy gained, represented as mgh. The force of gravity simultaneously does negative work on the object, but this does not cancel out the energy transfer; instead, it reflects the conservation of energy within the system. The net work done on the system is positive, as the external force contributes energy while gravity's negative work does not diminish the overall energy of the system. The concept of work must be understood in terms of energy transfer rather than a simple cancellation between forces. Ultimately, the energy balance illustrates that while forces act in opposition, the total energy remains conserved in the system.