The easiest way to explain how these three activities are different is to distinguish each term is to categorize them by difficulty.
The easiest of the three is hiking. You walk on well-marked trails of easy to moderate difficulty, although this depends on where you’re hiking. These are usually half-day to one-day tours. The terrain varies from relatively flat to steep.
Most hiking tours take anywhere from 2 to 8 hours round trip. You usually finish in the same place that you started, either from hiking a loop or returning the same way. Some hikes have a different start and end points, so always check before you start. For hiking tours, you need minimal equipment compared to trekking and mountaineering.
Trekking is between hiking and mountaineering regarding difficulty, although it’s more similar to hiking. The difference being that treks are longer than hikes. When I say longer, it doesn’t mean that they take a couple more hours. These trips usually take two or more days. This means that you will either have to camp (and bring all your food and equipment), Alternatively, when trekking in some locations, you may have the option to stay at small lodges, mountain huts or even bed and breakfasts along the way. Trekking is more challenging that hiking because you will be walking for multiple days in a rows.
Treks usually start in one place and end in a different one.
Of the three, mountaineering is by far the most challenging. It’s a more technical variation of trekking that takes you to higher peaks, often to ones that are over 5000 meters above sea level.
These are also multi-day trips that require a lot of previous physical and technical training. You need more equipment than with hiking or trekking and you need to know how to use it properly. For example, how to climb on ice with crampons and an ice ax, safely cross huge cracks on ice, survive snow storms, walk on glaciers, be able to rescue yourself with an ice ax. Also, you need to be strong enough to be able to endure long hours of ascending with extremely low levels of oxygen.