Hiking, in broad terms, means walking in natural environments. If you’re doing that, you’re hiking. Trek, on the other hand, is more specific. The word trekking comes from the Afrikaan word literally meaning “pull, travel.”
Trekking however is not necessarily leisure based, like hiking can be, depending on the length of the hike. However, some hikes are so long and challenging , they can hardly be considered leisurely. Trekking often involves traversing terrain that does not have any form of a road, where you are setting your own path. Trekkers usually navigate hostile terrain to reach far off and isolated places. Hikers are not always exposed to this situation, because of an amount of certainty to the activity.
The equipment that you need for a trek is very different from what you need on a hike. Usually hikers simply need a compass, a walking pole and a good pair of shoes, possibly a tent if they are staying overnight. Trekkers however have to carry camping gear, boots, food, clothing and a survival kit that includes other basic necessities.
Hikers who go on overnight trips may also need to carry some basic equipment, but it is not nearly as much as required for a trek. Trekking sometimes can extend for more than a couple of days, and in such cases the requirements increase manifold.
Hiking is usually considered short term walking, where trekking is a more challenging and difficult walk in uncertain conditions, that requires endurance and discovery of the environment.
Both require fitness to accomplish the task.