What two factors cause a nebula to develop into a star?

What two factors cause a nebula to develop into a star?