As a native German I've never really thought about this word until now but when reading your question, I was curious how zunächst can mean the same thing as zuerst while als nächstes is distinct to als erstes.
Als erstes = First of all
Als nächstes = Next (Second, third, fourth thing,... but never first thing)
But:
Zuerst = Zunächst = At first
I can't really answer how this distinction evolved (a quick Google search only gave a few hints but that's not enough for a conclusive answer), but with respect to your actual question it might help to look at it like this:
Erst means first and so you can interpret zuerst as the first thing.
While nächst can mean next, you need to know that nächst is derived from the superlative of nah (near, close). Hence, you can interpret zunächst as the closest/nearest thing.
You can see this meaning more clearly in its prepositional meaning where you cannot replace it with zuerst. DWDS defines it as unmittelbar neben or in nächster Nähe von. Example given there:
das Gebäude zunächst der Universität ist die Universitätsbibliothek
Meaning, the nearest building to the university is the university library.
Concluding, there's not much of a difference between zuerst and zunächst as an adverb; it doesn't matter if you talk about the first thing or the closest/nearest thing. It's the same thing after all.
A few further notes:
In the Grimmsche Wörterbuch they say zunächst takes zuerst as a "role model":
nach dem vorbild von zuerst
I couldn't make out the oldest citations, but zunächst seem to be in common usage since the 16th century.
Several dictionaries (like DWDS, follow the link above) separate the adverb zunächst into two similar meanings. The first is synonym to zuerst, the other synonym to vorerst, vorläufig. Here's an example from DWDS:
dieses Problem wollen wir zunächst ausklammern
I do think that you can replace it with zuerst but you arguably change the meaning slightly. The proper translation into English for this example might be "for now", "for the time being". That is, "(at) the present time" or "for a short period of time but not permanently".
DWDS also lists several meanings for zuerst. Unfortunately the definitions are not very clear to me and examples are missing, but 1b is clearly a case where you cannot use zunächst. Here's an example of my own:
Er ist zuerst[=als Erstes] ins Ziel gekommen.
In this context, you cannot use zunächst.