Brining involves two processes, Osmosis and Diffusion.
Osmosis involves the movement of solvent molecules through a selectively permeable membrane to an area of higher solute concentration. In the case of brining, it involves the movement of water out of meat cells, through the meat cell membranes, into the brining liquid.
What drives the movement of water is a higher concentration of dissolved solutes (fruit juices, spices, herbs, salt, and sugar) in the brine than in the water in between the meat cells.
Diffusion is the movement of dissolved solutes from areas of higher concentration to lower concentration, ultimately reaching equilibrium. Imagine a drop of food coloring in a glass of water spreading out until fully dispersed. In the case of brining, it pertains to the dissolved spices and herbs of the brine moving into the water in between the meat cells. This is a passive process that occurs over time.
Contrary to popular opinion, osmosis does not pump salt and liquid into the meat.
Diffusion is the process by which meat takes on liquid while brining but it is not the reason meat stays moist while cooking. This added liquid is only in the intercellular spaces and is not retained through the cooking process. That said, it is important as it helps the brine penetrate into the meat so effect of osmosis can reach every cell.Brines use Osmosis to draw moisture out of the meat cells, increasing the natural solute concentration in the meat cell. This process results in the denaturing (unravelling) of the proteins without breaking the cell wall as with acids (marinades) or heat (cooking). The protein, now partially unravelled, has more binding sites for the free floating water molecules in the meat cell.
The chemical bond between water molecules and proteins helps the meat cell stay intact at higher temperatures than unbrined meat. The result is a more desirable texture and an increase in the retention of the meat's natural juice through the cooking process.
For a more detailed read on the science of brining, I recommend the link below.