But one big question remains, namely "why?" After Apple scored such a huge win over Samsung in California court, it doesn't follow that they'd give up so easily with HTC. But if you look at the issue closely, you'll see that the deal is actually beneficial for both companies.
From Apple's perspective, it simply doesn't make sense to go after HTC. Not only is it a much smaller competitor than Samsung but it utilizes a design language that would make a successful lawsuit unlikely. With the Galaxy S, Apple found a perfect target that they likely won't be able to find among HTC's current stable.
HTC is also small enough that any court win probably wouldn't result in too much money in damages being handed out to Apple anyway. Apple wouldn't gain too much in a lawsuit against HTC, but they could lose a lot – of time, money and even in the arena of public perception, should they lose. A big court case could result in free publicity for HTC.
Finally, you might want to consider the old adage "the enemy of my enemy is my friend" when thinking about the logic of this agreement. HTC now gets to use all of the Apple features that Samsung is barred from using, making them a trifle more competitive in the smartphone market. In Apple's eyes, any company that could challenge Samsung is a good friend to have.
Overall, this is a very surprising announcement and could pave the way for more agreements over time (next up, Motorola?). But Apple would be hard pressed to find an agreement with a partner more strategically important than HTC. While I would love to think that the patent wars will end tomorrow in more agreements like this, the truth is this is probably a one time thing.