How do commercial flights get overbooked? The other week my flight was overbooked and so the airline looked for volunteers to take another flight the following morning. I can't stop thinking about this since the number of seats available and sold should've been known to the airline for quite some time.

Someone claimed that airlines expect a number of passengers to rebook or not show up and thus with purpose overbook sometimes. Can this really be true? Or is it a data consistency thing where availability for ticket booking is prioritized? Or was it perhaps due to an unplanned change of aircraft model? I'm certain there might be other answers and that reasons may vary from occasion to occasion and different airlines, but please enlighten me here!
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.