The key parameter - rarely quoted - is the duty cycle. If rated for continuous, then a 2HP VFD can handle a 2HP motor running 24/7/365 with room to spare. Almost nothing is up to this task.
Building a wee bit on
@mbond's comments, it sometimes helps to think of duty cycle in terms of the application.
A pump is typically a 100% duty cycle. Pumps typically run full load most of the time.
A conveyor belt is similar but might not always carry a full load. However, the fact that it could carry a full load for hours on end means it has to be designed for a 100% duty cycle.
A mill almost never sees its maximum load for hours on end. For the most part they operate well below that. Even during spin up, mills see very little load. There is little to no point in up sizing the motor on a mill.
A lathe is the same except that spin up time is usually a full load exercise for the motor because of the size, weight, friction, and complexity of the drive train. For this reason, it is a good idea to upsize the motor but then limit the actual hp requirements by setting a spin up time that is the same or less than before.
In all cases, it is good to remember that nothing is stronger than its weakest link. In most machines, the weakest link is usually the drive train. Adding a bigger motor doesn't make the drivetrain any stronger. So it's not usually a good idea to add a bigger motor and then go buy bigger tooling too. It is better to buy a bigger machine if you need to use bigger tools or increase production.