It's funny to still see these issues being hashed, when they've been documented by Firaxis! But I guess it's been proven that folks don't read FAQs
Anyway, knowledge of the map and resources has been confirmed by Firaxis. This leads to a couple behaviours:
1) It will found cities in locations to get strategic resources, and it will favor those locations when deciding where to found next. In other words, it will found these cities first.
2) The AI knows of all viable city founding locations, and is programmed to spread like a weed, so it will build a settler / defender combo for all the city locations it has "in mind". However it is not "allowed" to use the inherent map knowlege to go found these cities until it has explored these lands, which is why as soon as you sell your map, you'll see settlers (which were already built) heading to the 1 square you don't yet control. If you plant a unit at that square, you'll see the settler turn back too! In other words, the AI ends up with surplus "pre-built" settlers.
3) It will value a city with a strategic resource, even one ages away, more highly when being extorted for peace.
4) The AI doesn't "know" where you are going with a settler in order to beat you to it. What it does have is a plan as to how best to lay things out (see above) which it is following. It just happened to beat you to this particular site. If it had horses or iron visible, you shouldn't be surprised at all!
Cheers,
Shawn