How do commercial flights get overbooked?
Airlines have lots of historical data for any given flight segment that they can use to give statistical probabilities of people missing flights due to various factors such as misconnection or just not showing up.  An airline is a profit driven corporation and to maximize revenue they want full airplanes.

If they know for a flight that 5% +/- 2% of passengers fail to board they can pretty safely sell around 103% of the seats to maximize passengers and minimize risk of overboarding.  Statistics are averages, however, and if you sell 103% of your capacity it is entirely possible for a given instance of that flight to be overbooked.  

In most cases of overbooking, volunteers can be found that will give up seats if the plane becomes full.  US airlines generally top out at around $800 compensation for volunteers, so if you are willing to do so it can be advantageous to wait for them to get desperate for volunteers.  If no volunteers can be found it is possible to be involuntarily bumped off the flight and you should consult with the specific airline for any rights you may have in that case.