The difference between 'only' and 'merely'

Can anyone explain me the difference between ‘only’ and ‘merely’.

Can I say for instance:
I will merely get something to eat. (which means that I will only get something and return immediately after that)

Or do you only use ‘merely’ with the past tense?

“Merely” is not used all that often. It is slighty more defensive or negative than “only”. When I say “I merely asked” it means that I didn’t like the way you responded or reacted. “Merely” comes from the adjective “mere”.
You would say: I 'll only (or, just) get something to eat, merely sounds a bit unusual in this case.