Answer: It doesn't, there are two guns. Ana Lucia has a Beretta 92FS with one bullet which is used when she kills Shannon and the gun she uses later was a Glock obtained from Sayid in the ensuing chaos and fighting.
Long version with evidence:
A transcript of Collision S02E08 explains that this is indeed what has happened.
[Sayid pulls out his gun and goes after Ana.]
MICHAEL: Sayid! Sayid, no!
[Eko tackles Sayid and they fight. Ana cold-cocks Sayid, and grabs the
MICHAEL: Hey, hey!
ANA LUCIA: [pointing the gun at Michael] Don't move! Nobody move!
Also you can reference the different guns and who had them at www.imfdb.org
Breakdown of events:
1. Beretta has been fully fired
Ana Lucia shoots Shannon with the one bullet from the Beretta 92FS that she stole from Sawyer. Note in the image that she is holding a Beretta which is fully discharged as the chamber is open.
2. Sayid has a Glock and loses it in a fight with Mr Eko
After this Sayid pulls out his own gun and charges Ana Lucia, only to be attacked by Mr Eko, causing him to drop the gun. Sayid and Mr Eko proceed to fight over Sayid's gun which from what I can tell is a Glock 17 or 19 and not the Beretta.
3. Ana Lucia now has the loaded Glock from Sayid
Ana Lucia then joins the fight and takes out Sayid and grabs the Glock, which is likely fully loaded or at least has more than one bullet, and this is the gun that she now uses to threathen the others and fire warning shots with.