It's my impression from skimming the literature just now that much of the current activity in this field is based on N-body simulations. It's hard for me as an outsider to evaluate the analytical scenarios that are being tested, but I think that the key idea is that certain Lindblad resonances which excite density waves are the main instabilities that lead to bar formation. See also section (4) of this page, which gives a broad overview of stellar dynamics in galaxies.
In short, there are several guesses out there. See this paper by <PERSON> for an overview of the understanding of galaxy shapes in general in 2002.
The key citation in the wikipedia article linked to by Cem is a 2002 paper by <PERSON> and <PERSON> (free on the arxiv) which describes gravitational N-body simulations which follow processes of bar formation and re-formation. They find a strong dependence on the frequency of bar formation on the distribution of mass in the galaxy:
A galactic disk may either keep a single bar or get several successive bars. By simulating several disks, we study the dependence on physical parameters. We find that the two determining parameters are the bulge to disk and halo to disk masses ratios. Light bulge galaxies maintain their bar, while bars are destructed and regenerated in heavy bulge galaxies. The halo mass has also an effect on the disk evolution.
Another paper from 2002 by <PERSON> and <PERSON> does a different simulation and observes that a bar is formed in their model galaxy due to the tidal forces from a satellite galaxy. 682
Here's a related image from their paper:
Caption: Fig. 4. The tidal triggering of bar instability by a satellite. At z=1.6 the disk develops a well defined, long-lasting bar pattern as a result of tidal forcing by the satellite shown in the z=1.2 panel. The satellite is finally disrupted at z=1.18 after 7 pericentric passages. The bar pattern, however, survives for several Gyr, as shown in the picture. Stars less than 1.5 Gyr old are shown in blue, older stars in red. Note that the bar is most prominent in the young component. Horizontal bars in each panel are 5 (physical) kpc long. 758