Does SN2 favor strong nucleophile and SN1 favor weak nucleophile? Does E2 favor a strong base, and E1 favor a weak base? I understand if you have a protic solvent, it will stabilize the strong base (to form weak acid) or the strong nucleophile. The protons would react with them. To have an SN2 or an E2, so you need an aprotic solvent. I also know that in general, a tertiary substrate will favor SN1/E1 reactions, because a tertiary carbocation is more stable. A primary substrate will SN2/E2 reactions, because of less stereo-hinderance.

But why does SN2 favor strong nucleophile and SN1 favor weak nucleophile from the first place? Besides, does E2 favor a strong base, and E1 favor a weak base? I also don't get the reason.
That's not the right view.

The $S_{N}2$ mechanism does not favor strong nucleophiles. That statement doesn't make sense at a high level. Mechanisms can't favor anything.

The key here is to look at what controls reactivity in $S_{N}2$ and $S_{N}1$ reactions.

The former is concerted where the bond breaking and bond forming take place at the same time. Therefore, the strength of the nucleophile is important as is the propensity of the leaving group to leave.

In the latter mechanism, there are two steps, bond breaking and bond forming, where bond breaking is the slower and more difficult step. Since the nucleophile is not involved in that first step, the strength of the nucleophile simply doesn't matter.

Similar considerations apply when looking at elimination reactions.