Origin and Destiny of Dark Matter Halos: Cosmological Matter Exchange and Metal Enrichment