The hammer hit the bullet, so it stopped.

Who is "it" in this prior sentence?
The hammer
Jim taught John rhetoric to become a lawyer, but he did not get paid.

Who is "he" in this prior sentence?
Jim
Stargate Atlantis was replaced by Stargate Universe since they were not doing very well in the ratings.

Who is "they" in this prior sentence?
Stargate Atlantis