It presumably is because of this original meaning (the verb “to pray”) that “prego” has become the instant reply to “grazie”, which means “thanks”. Once it presumably was an expression to wish someone well who had been nice to you, something like “I pray for your well-being”.