To use a graphics card for increased decoding/encoding speed when transcoding video.
WARNING: Hardware acceleration will usually produce lower quality results than when using Software encoding.
Hardware acceleration is definitely not using the same encoder, just ported to a GPU, it is actually using a fully different encoder.
Not only are the algorithms very different on hardware, but also the parameters do not match versus a software encoder.
e.g. the crf parameter in an encoder does not necessarily have the same effect in another encoder, and the same value can result in completely different effective quality (the parameters and their scales are not standardized).
The hardware encoder in the graphics card is usually tailored for speed; above quality.
This is a trade-off in order to keep complexity down.
Hardware encoding uses fixed function blocks which are far less versatile and adaptable than software encoders.
The video quality of hardware encoders is usually pretty fixed, and there is not a lot of room to adjust video quality with hardware encoders.
As a result a software encoder will get better results 99 times out of 100.
A huge amount of development effort, time and cost would be needed to get hardware to be as full-featured as a software encoder.