Cleopatra killed herself because she was captured by the Romans. She was also pregnant with twins, and decided that if she had to die, she would rather die on her own terms than be humiliated by the Romans in front of her people.
Cleopatra was born in 69 B.C., the daughter of Ptolemy XII Auletes, who had been expelled from Egypt by his subjects for gross misrule. After trying unsuccessfully to regain his kingdom by force, he appealed to Rome for help. The Roman Senate voted to restore him to power and send an army to Egypt in support of his claim. Julius Caesar arrived with this army in 47 B.C.
Caesar returned to Rome after this mission, but Cleopatra remained behind in Alexandria because she feared for her life if she returned home before her brother Ptolemy XIII came of age (he was only 14 years old at the time). Caesar paid little attention to Egypt during most of his Roman career—he spent most of his time fighting wars and making political enemies—but when he was assassinated in 44 B.C., Mark Antony became consul and took charge of affairs there.