pKa and pH are related concepts but often confused. pKa is a property of a compound that tells us how acidic it is. The lower the pKa, the stronger the acid. pH is a property of a particular solution that depends on the concentrations and identities of the components.
For this discussion, I'm going to use the terms protonated and deprotonated to mean that a compound is associated or dissociated with a proton.
Based on the relationship between the pKa of a compound and the pH of a solution, we can predict whether a compound will be protonated or deprotonated. If the pH is lower than the pKa, then the compound will be protonated. If the pH is higher than the pKa, then the compound will be deprotonated.
A further consideration is the charge on the compound. Acids are neutral when protonated and negatively charged (ionized) when deprotonated. Bases are neutral when deprotonated and positively charged (ionized) when protonated.
Given the information you provided, if compound A (with pKa 7.9) is in a solution of pH 5.2, compound A will be in the protonated state.
Without knowing anything about the identities of A and B, the following is speculation. Most likely compound A is a base and compound B is an acid. The protonated version of A (its "conjugate acid") is more stable for long term storage than A itself.
Another possibility is that compound A is an acid and B is a stronger acid. If the deprotonated version of A is unstable, then compound B is added to ensure that if the mixture came in contact with a base, something more acidic than A would be present to react with the base.
EDIT BASED ON NEW INFORMATION:
As Mateus B said, lidocaine will be protonated by HCl at the amine nitrogen. This is likely done for two reasons. First, as its hydrochloride, it will be more water soluble. In solution, the compound will dissociate into protonated lidocaine cation and chloride anion. Second, as the nitrogen is protonated, it is less reactive to the environment. Over time, amines can react with oxygen to form the corresponding N-oxide and/or can absorb carbon dioxide.