Building on this... it's worth understanding what "gain" actually means, as a lot of people don't really know, or misunderstand. This requires a basic understanding of how guitar amps work.
Traditional guitar amps have two stages: a "pre-amp" and a power amp.
The low level signal from the guitar is fed into the pre-amp which is an amplifier that (amongst other things) boosts the signal up to a level that the power amp can deal with.
The power amp then deals with driving the speakers, which are mechanical devices and which require quite a bit of power to move them.
Gain is simply a measure of how much a signal is amplified.
On a guitar amp, the pre-amp has a gain control that impacts how much the low-level signal from the guitar is amplified by the pre-amp. All amplifiers have a physical limit on the signal they can output. This is primarily set by the power supply for the amplifier: for instance if an amplifier has a 12V power supply, then it cannot output a signal greater than 12V peak. If it tries to, say, output a signal of 15V, then anything above 12V will be limited to 12V.
So, if you turn an amplifier circuit's gain up to the point that the amplified signal is greater than the amplifier itself can handle, this will cause "clipping".
This is the "clipping" in LievenDV's image. In most types of amplifier applications, such as home stereos and PAs, this sort of clipping is highly undesirable. In guitar amps, it's very desirable and so they are designed so that they clip easily.
Different types of circuit will clip in different ways. Roughly, tube circuits will soft clip and transistors will hard clip. However, transistor circuits can be designed such that they soft-clip as well.
So "overdrive" is where the amplifier circuits are "driven over" what they are capable of. This causes the signal to be distorted. Any change to the signal is "distortion".
Thus overdrive is, itself, a form of distortion. In the guitar world it's taken to mean a milder, less heavily clipped form of distortion. There's no distinct line separating overdrive and distortion caused by clipping.
On a guitar amp the degree to which the signal is distorted is controlled by how much the original guitar signal is amplified by the pre-amp, aka "gain" (it's also dependant on the output level of your guitar pickups, guitar "volume" knob, and how hard you pick or strum the strings). The higher the gain control is set, the higher the signal is amplified by the pre-amp and the more the signal is pushed beyond the amp's limits and distorted, which is where we get the term "high-gain" from.
This video demonstrates clipping distortion using a limiter:
A "boost" pedal will help the guitar amp push into overdrive by providing an additional amplifier stage (a "pre-pre-amp"?) before the guitar amp to boost the signal into the guitar preamp. This makes it so you can push the signal into overdrive at lower gain settings on the guitar amp, or so you can get higher levels of distortion than the amp can achieve on its own.
Typically boost pedals are switchable and can be used to switch the level of amp overdrive/distortion up when going from rhythm to lead.
This has all been about distortion caused by overdriving the circuits of the guitar amp itself.
Alternatively, overdrive/distortion pedals (including multifx pedals) will typically have their own amplifier or amp emulation circuit in them which will create the overdriven/distorted tone in the pedal itself. You can then choose whether you want this further overdriven by the guitar amp or not. Often these pedals are used with a clean tone, allowing you to switch between clean and overdriven/distorted.
Sometimes these pedals are designed to closely emulate the sound of a guitar amp going into overdrive. In other cases, they are their own distinct circuits with their own distinct distortion character, which is different from the distortion in an amplifier.
There are other forms of distortion too. For instance, "fuzz" is supposed to be based on the distortion caused by a damaged speaker cone.
Cheers,
Keith