This line completes the previous one: Mexico’s eternal destiny “was written by the finger of God.” The image is highly religious and poetic. It presents Mexico’s destiny as something not merely chosen by people, but marked out by divine will.

Dedo means “finger,” Dios means “God,” and se escribió means “was written.” The passive phrasing can feel indirect to learners: literally, “by the finger of God it was written.” Together with the previous line, the meaning is that the homeland’s destiny was written in heaven by God.