Salts are essentially the product of any base reacting with any acid.
Some salts are neutral - these are the products of STRONG bases with STRONG acids (e.g.: NaCl).
Some salts are acidic - these are the products of WEAK bases with STRONG acids (e.g.: NH4Cl).
And some salts are alkaline/basic - these are the products of STRONG bases with WEAK acids (e.g.: Na2CO3)
The reason for whether or not salts are acidic/neutral/alkaline has to do with chemical equilibriums, which is a subset of physical chemistry. I think at your current level, it is not important to get into
I will merely give you some examples for how it works.
To make NaCl
we'll make NaOH + HCl -> NaCl + H2O
that NaCl will dissolve and dissociate (split) to NaCl -> Na+ + Cl-
Neither Na+ or Cl- withh hydrolise - that is, react with water.
To make NH4Cl, we'll mix NH3 + HCl -> NH4Cl
NH4Cl dissolves and dissociates (splits up) in an equilibrium (indicated by arrows pointing both ways) to NH4Cl <-> NH4+ + Cl-
Cl- does NOT hydrolise
NH4+ however, DOES hydrolise. It hydrolises thusly in an equilibrium: NH4+ + H2O <-> NH3 + H3O+
Because more H3O+ is produced at the end of this reaction chain, the solution becomes ACIDIC.
To make Na2CO3 we'll mix 2NaOH + H2CO3 -> Na2CO3 + 2H2O
Na2CO3 dissolves and dissociates in an equilibrium to Na2CO3 -> 2Na+ + CO3(2)-
Na+ does NOT hydrolise
CO3(2)- hydrolises to CO3(2)- + H2O <-> HCO3- + OH- and HCO3- + H2O <-> H2CO3 + OH-
The reaction is done in 2 steps, with the second one occuring in much smaller ratio to the first one. However, both produce OH-, meaning the solution becomes alkaline.
THe important take away is that ions left over from a STRONG acid/base (e.g.: Na+, Cl-) do NOT hydrolise.
The ions left over from a WEAK (acid/base) (e.g.: NH4+, CO3(2)-) DO hydrolise.
Weak acids/bases are very roughly defined by needing to dissolve more moles of them than strong acids/bases to reach the same pH. This is because when dissolved, they do not dissociate entirely (meaning, they enter an equilibrium).