What is difference between благодарю and спасибо?
благодарю is not a formal one or no more formal than спасибо.
благодарю came from old bulgarian that is the base of Church Slavic . There is still duality of languages in modern Russian . There is a number of old bolgarian roots that are the synonyms to russian ones . for example you can say "Ждите" and "Ожидайте" (Wait) / where жд root is from old bolgarian and ожид is from old russian.
But some of the old bulgarian origin words are more poetic. Thus благодарю in the context of "Thank you" is just more poetic.
But as a verb in context "He thanks for a meal " the only possibility is to say "Он благодарит за еду" , you can't say "Он спасибит за еду"
спасибо is used casually, like if you're asking someone to pass the salt. it can be "intensified" by saying "большое спасибо"- literally translated "big thanks", but non-literally meaning "thanks a lot". благодарю is more "intense" and more formal, as well as sometimes more flamboyant.