Frozen Fish Stick Blues

Some fish contain relatively large amounts of mercury. Where does this mercury come from, and why does it remain inside the fish that ingest them?