There's no generally-agreed-upon difference. Some universities that offer both have slightly different requirements, but many schools offer only one or the other for historical reasons, and as a practical matter, graduate schools and most employers treat them identically.
I have a Bachelor of Arts in physics; an acquaintaince of mine has a Bachelor of Science in creative writing.
It has to do with the core requirements you take. For a BA you usually have to take a specific amount of credits of a language as well as more college of liberal arts classes, while a BS has more math and science. Often schools have multiple paths for each so you can choose what really is the right one for you.
"Arts" in this sense isn't stuff like drawing and painting - the *liberal arts* consist of things like literature, history and the like. "Science" OTOH consists of things based strongly in math.
In most American universities, most programs only have a BA or a BS option, depending on the subject matter. When you do have an option, the BS will have more math/science requirements while the BA gives you more freedom to pick electives or an unrelated minor.
My degree is studio art with an art history minor, but it is a Bachelor of Science degree as I did not take 2yrs of foreign language.
Bachelor of Science degrees are more specialized in the field, while Bachelor of Arts degrees have more generalized requirements.
The BS class requirements are more specifically geared towards the major, the BA class requirements are generally more well-rounded.
I have a BS in Health Administration. It's similar to a BA in Business, but hyper-focused on the business of healthcare.
In my experience a BA tends to focus around an "arts" major - something not in the hard sciences. A BA student will take a bunch of courses in the field of their major, as well as a large number of optional courses from other Arts fields (psychology, philosophy, history, languages, literature, sociology, classics, music, etc.). A BA student needs to take a couple of science courses but usually only 1 or 2.
A BS student is the inverse of that. Their major will be in a hard science or engineering. Their optional courses will be in other sciences outside their major (a chemistry student may take a physics option for example). They will only need 1 or 2 courses in the arts fields.
There is a weak trend for a BS to be sciences (Physics, Chemistry, Biology) and a BA to be not-sciences (History, English, Philosophy).
But mostly it is an evolutionary process based on how the university was initially set up, and how the various departments in the university evolved as new programs were added. If the new Economics program as an offshoot of Math, it might be part of the Sciences program, if it came from Business, it could be Arts instead. Or it could have come from the Bavarian Folk Dancing department because that is what some wealthy patron wanted.