adverb
thoughtlessly; recklessly; indiscriminately
Doing something without careful thought, often with negative consequences. Covers acting rashly, without discretion, or at random.
むやみに人を信用してはいけない。
You shouldn't trust people indiscriminately.
彼はむやみに車を飛ばして事故を起こした。
He drove recklessly and caused an accident.
adverb
excessively; unreasonably; absurdly
Going beyond reasonable limits; used when an action or amount is immoderate or absurdly high.
むやみに高い値段をふっかける店だった。
It was a shop that charged absurdly high prices.
むやみに食べ過ぎてお腹を壊した。
I ate excessively and got a stomachache.
Both mean 'indiscriminately' or 'excessively', but やたらに is more colloquial and often implies a high frequency or intensity, while むやみに emphasizes lack of thought or reason.
でたらめに means 'randomly' or 'haphazardly' with a nuance of nonsense or irresponsibility, whereas むやみに focuses on thoughtlessness or excess.
Derivation uncertain. The kanji 無闇 and 無暗 are ateji, and the word is native Japanese. Possibly related to the old adverb むや (vainly, uselessly) with the suffix み, but this is not confirmed.