What this suffix does
The suffixes -ance and -ence take a verb or adjective and create the abstract noun naming that state, quality or process. From "import" you get "importance"; from "differ" you get "difference"; from "exist" you get "existence".
Both suffixes mean the same thing. The choice between them depends on the word's root and origin, not on meaning.
Spanish cognate advantage
-ance/-ence almost always corresponds to -ancia/-encia in Spanish:
importance = importancia
difference = diferencia
existence = existencia
experience = experiencia
science = ciencia
If Spanish uses -ancia or -encia, try -ance or -ence in English. The hit rate is very high.
When to use -ance vs -ence
Honest answer: there is no perfect rule. But there is a reliable shortcut: look at the related adjective.
If the adjective ends in -ant (important, significant), the noun uses -ance: importance, significance.
If the adjective ends in -ent (different, confident), the noun uses -ence: difference, confidence.
When unsure, the Spanish cognate (-ancia vs -encia) almost always gives you the answer.