The Pentax K-7 is a fine camera and I enjoyed it but it suffered a bit from its youth. The high ISO in the new sensor is slightly worse than the K20D at same ISO and the video formats were a bit weird compared to other cameras (no 1080p, just 720p and a larger but different format as well). It was also using the old SAFOX auto-focus system and that one was getting outdated.
Enter the Pentax K-5: 16 Mpxls in a new sensor with better high ISO performance, an enhanced SAFOX auto-focus, SDXC support for larger and faster SD cards but encased in the same small and light body of the K-7.