abitslow made a mistake when he was explaining the free energy concept. All systems tend toward the lowest possible energy configuration. The statement that the products have to have a higher energy than the reactants is exactly backwards, unless something else was meant.
ΔG° = ΔH° + TΔS° describes the free energy of a system, the equation has two terms. The first involves the enthalpy which, on a microscopic scale, can refer to electrostatic interactions between molecules, solvents etc. The second term involves temperature and entropy. Without getting too crazy we'll just consider entropy as a measure of "disorder" of a system. I sometimes explain entropy by telling people to imagine how many unique "pictures" they can take of a system, the more unique pictures the higher the entropy. Don't worry about this too much for now, you'll just confuse yourself even more. Also let's not get into the little degree sign in the equation, its a not exactly relevant to the question at hand.
In the simplest terms, a process/reaction with ΔG° < 0, as written, will happen spontaneously (fancy way of saying, you just mix the stuff and it will go) while the opposite is true when ΔG° > 0. When ΔG° = 0, the system is already at equilibrium. As you can see a process is favorable when the ΔH term is negative and the ΔS term is positive (remember the negative sign in front of the TΔS). You can also consider how each term can "overpower" the other. For example we can have a small positive change in enthalpy but a large (also positive)
change in entropy which will still lead an overall negative ΔG.
The link between an abstract quantity such as free energy (ΔG°) and something tangible, like the ratio of products/reactants in a system is straightforward: ΔG° = -RTlnK°eq. The Keq is called an equilibrium constant and only varies with temperature. It is simply the ratio of concentrations of products divided by the concentrations of reactants, each raised to a power corresponding to their stoichiometric coefficient in a balanced chemical equation. With acids and bases chemists needed to be difficult and defined something called Ka and Kb where they each describe a very specific reaction (HA + H
2O → H
3O
+ + A
- for Ka and the reverse for Kb). Just remember that Ka is simply a special case of Keq which is linked with the abstract concept of free energy (ΔG°).
Now we can start evaluating things based on energy. Chemists have come up with empirical rules for qualitatively evaluating systems and making educated guesses about what should happen. So in the case of something like HCl, we say that the free energy of the system decreases when HCl (in water) dissociates into a proton and the chloride anion, it is tough to describe how exactly the entropy behaves but we do know that the enthalpy is very negative because throwing something like HCl into water will heat up the water considerably. We can go a step further and talk about the energetics of the products, but that is always in relation to the energetics of the reactants. We can make some trends up to show that the anion which gave up the proton plays an important role in the energetics of the system, all else being equal. For haloacids (HI, HBr, HCl etc) we can talk about the charge density of the anion which decreases down the periodic (same amount of charge with a larger area). You can look up the Ka's, most likely the pKa's which are -log(Ka), for the various haloacids and the ionic radii of the anions which are produced.
If we take the example of acetic acid, we come to a charge density argument once again. A good comparison for the acetic acid case is something like ethanol. Each have a proton which can leave and an oxygen based anion is produced. Acetic acid is ~10
10 more acidic than ethanol. Well, the reasoning is that the negative charge produced in acetic acid is delocalized over two oxygen atoms whereas in ethanol its "stuck" on a single oxygen. Charge density at work once again.
This can get much hairier but I will end the discussion now by reiterating that free energy is minimized in a system. If a reaction happens, such as HCl very nearly fully dissociating, then the system has a lower free energy. Dissecting the specific energetics is not really a simple process but we can look at trends and such and come up with rules of thumb but at this level its not going to be the "full picture."