The reason for heat not being completely converted into work
Heat cannot be completely transformed into work because of the entropy that heat contains because of this entropy, heat always gets lost in the surroundings, this is why it is also called low-grade energy.
On the other hand, work can be completely converted into heat under some conditions and this is why work is also known as high-grade energy.
The Kelvin-Plank statement of the second law of thermodynamics, It is impossible to build a device that can completely convert heat from a single reservoir into work.
Hence, the heat cannot be completely converted to work