Frontier and border are synonyms,but are used in different contexts.
Border is talking about a specific edge of the country or an area. Something that can be clearly marked. It’s usually an official property line that marks where one country/area begins and another ends.
The US border with Canada is huge.
Frontier is something more general. It is not a specific line, but an area. It is usually an area or a district near the boarder line.
Soldiers were guarding the frontier near France.
Frontier can also be used to mean a certain limit.
frontiers of knowledge, frontiers of mathematics, etc.
I hope it makes much more sense now. 🙂