High muck-a-muck (also high muckymuck and even high mucketymuck) is a North American English slang term adapted from the Chinook Jargon (or Tsinuk Wawa) pidgin used as a lingua franca among the Native American tribes and those of European ancestry along the Pacific coast from Oregon as far north as southern Alaska in the 19th and early 20th centuries. (There doesn't seem to be a connection to the older English word muck.)
In English, it means an important, high-ranking person, often one who acts pompously. However, in Chinook Jargon, the meaning of the phrase pronounced "hayo makamak" was "plenty to eat," from the Nootka language "makamak" meaning food, or specificially "the part of the whale between blubber and flesh" according to dictionary.com. The transition from the original meaning to the new one comes through the potlatch ceremonies of the Pacific Northwest cultures, where events with great feasting and giving away of gifts were a way to show social status. Therefore, a person with plenty to eat was someone of high rank and standing among others. Settlers sometimes viewed the the events as peculiar and wasteful, though, which is probably how the connotation of self-importance became attached to the phrase.
English speakers changed the spelling of "hayo" to match the English "high," or left it off for just "muck-a-muck" or other spellings. As Chinook Jargon had largely died out in everyday usage (until a revival effort in the early 2000s), most English speakers who had heard the phrase just considered it a nonsense title for an elevated position, like "grand poobah."
Sources:
http://wordsmith.org/words/high-muck-a-muck.html
https://grammarist.com/usage/muckamuck-mucky-muck-and-muckety-muck/
https://www.grammarphobia.com/blog/2008/01/high-muckamucks.html
https://en.wiktionary.org/wiki/muckamuck
https://www.dictionary.com/browse/high-muck-a-muck
https://en.wikipedia.org/wiki/Chinook_Jargon