The surprise is due to her lack of experience. She's been governor of Alaska for less than two years. Before that she was mayor of the town of Wasilla, Alaska, a small city or town, depending on your definition.
But her relative lack of experience is not merely in governing, but in electoral politics.
Here are the election results in the years that Palin was returned as mayor.
- in 1996, Palin defeated incumbent mayor John Stein 617 to 413.*
- in a rematch in 1999, Palin defeated John Stein 826 to 255.**
- *Source: Anchorage Daily News, October 2, 1996
**Source: Anchorage Daily News, October 6, 1999 (also here)