How does a free iPhone with purchase of 2 year contract work?

I have a tracfone now and I'm looking to get an iPhone. How to I go about this? What are the best plans? Also, what exactly is a two year contract?

A two-year contract is a contract that you sign that says you will pay your bill for 2 years in exchange for getting a discount for the phone. I have used Tracfone or Net10 since 2001. I also signed a contract with Verizon in 2009. Half way through the contract I started pricing new Net10 phones and immediately went back to Net10.
I would look into a prepaid provider like Net10 or Straight Talk. The monthly bill will be about half of what it would be with a contract provider.

You get it from a carrier, at&t, verizon, sprint, etc.