Despite the popular view, it does not commemorate the three-day fast described in the Megillah (Esther 4:16). Three days cannot be telescoped into one day, and in any case our Fast of Esther is not mentioned in the Megillah or ordained in the Talmud.
The late tractate Sofrim (21:1) does state that the sages of the Land of Israel did fast for three days before Purim, but not on consecutive days because such a long period of fasting would constitute a danger to life.
According to the Bet Yosef (Orach Chayyim 686), the one-day fast was introduced by the medieval ge’onim to recall a pre-Purim fast of the entire Jewish people, ordained to pray for protection from antisemites like Haman.
The name Ta’anit Esther is said to have come about like this: those who were involved in the fight with Haman’s supporters had to eat and drink in order to keep up their strength; Esther, safe in the royal palace, did not fight and was able to fast, which she did for the sake of her fellow Jews. So Purim benefited everyone, but the fast was Esther’s fast.