The Roman Republic collapsed as a result of a series of events all of which can be traced to the Punic Wars with Carthage. The war had been expensive for the republic; and in addition many of the soldiers who fought in the war returned to farms which they had been forced to abandon. The farms were in very bad shape and a number of wealthy Romans offered to buy the farms from the soldiers. Those who sold not only lost their income, they also lost their right to vote, as only landed citizens could vote. Those who bought the smaller farms consolidated them into large operations known as latifundia which could operate on large economies of scale. This allowed them to squeeze smaller farmers out of business, who were also forced to sell to the wealthy. These events caused increasing class tension which soon erupted into a civil war.
Roman soldiers, with no source of income, often pledged loyalty to their commanding officers rather than to the republic. Leaders on either side were Gaius Marius who led reformers who hoped to correct the inequality problem; and Lucius Cornelius Sulla, who led the aristocrats. When Maurius died, Sulla had anyone deemed "proscribed" declared an enemy of the people who was to be killed on sight. Wholesale slaughter resulted. A number of generals raised private armies and which they might lead against the government.
Julius Caesar was one of those generals who spent his own wealth to entertain the masses (and thereby earn their loyalty) with gladiatorial games, etc. In an effort to preserve peace, Caesar, Marcus Crassus and Pompey formed the first Triumvirate. Caesar was given command of Gaul with the understanding that he would remain on the far side of the Rubicon River. When Crassus was killed in battle, Caesar crossed the Rubicon and marched on Rome. Pompey fled to Egypt where he was killed and Caesar had himself declared dictator under the provisions of the old Roman Constitution. This marked the death knell of the republic and the birth of the empire.