Sway bars are a link between the suspension on the left and right hand side of a vehicle; they help the two sides work together, to distribute cornering forces and keep the vehicle flat in a corner. Virtually every car has them; only the very cheapest cars don't, since they are so essential to making a vehicle handle safely and smoothly.
Here is an example of a sidecar unit set up with and without a sway bar. Watch what happens to the sidecar suspension as the bike moves up and down. Note that with the sway bar installed, the motorcycle stays vertical instead of tipping from side to side.