I know that Monte Carlo is used to approximate an integral by sampling. I also learnt MCMC algorithms such as Metropolis-Hastings and Gibbs sampling but I don't know where the "Monte Carlo" part is in those algorithms. Those algorithms are just sampling.
As I explained earlier this week in my introductory lecture to Monte Carlo methods, the founding principle of such numerical methods is the Law of Large Numbers, or the stabilisation of empirical frequencies to their expectations. Markov chain Monte Carlo algorithms are a special case of methods implementing the Monte Carlo principle, in that Markov chains are created with the specific purpose of preserving the convergence of empirical averages, which is then called the ergodic theorem. And with the rationale that these Markov chains are easier to produce than iid simulations from the given target.
Further links on this forum on the meaning of Monte Carlo: