BaSO4 is called Barium sulfate. It is a salt. A salt can be produced from the reaction of acids and bases. If we track down the reaction of the production of BaSO4, we can see that Ba^2+ comes from the base and SO4^2- comes from the acid.
H2SO4 (aq) + Ba(OH)2 (aq) ----> BaSO4 (solid) + 2 H2O (liquid)
ACID + BASE -----> SALT + WATER
Barium sulfate is an insoluble salt. Meaning, it cannot be dissolved in the solution of water. That is also the reason why it precipitates out in the solution.