I believe payment gateways are used for facilitating online transactions and helping them get approved and flowing through the payment funnel. Merchant accounts are for collecting the funds sent to the merchant on successful sales and are paid out to the merchant.
I am certainly not an expert on this, but this article from 2016 seems to explain it well.
If you're interested in merchant services, definitely check out our partner, International Bancard: https://startupnation.com/internationalbancard/
Payment gateway is just a software that makes online payments possible. Payment providers are companies that provide such software.
Merchant account is a special trading account that is used to store funds untill they move to your personal bank account. All transactions must be monitored and merchant accounts serve as a border between personal bank account and a customers' money.