His district is gerrymandered just enough (about 1/3rd of Waukesha County, missing out on close to half of Rock County), that it would take a incredibly massive wave to flip the seat. Ryan wouldn't have lost numerous times if there would have been a fair map where Waukesha County wasn't split in two, like it was before 2002.
Fake news! Ryan's district had about 6500 voters in Waukesha County even in the 2000 election.
At the time, Waukesha County was split into 3 districts, with about 113k votes in the 9th district, 76k in the 4th district, and 6k in the 1st district as of the 2000 elections.
Of course, at the time, extremist Tammy Baldwin had nearly lost the 1998 and 2000 elections in the 2nd district. So David Obey carved out a safer district for her, which is why Democrats mostly supported that redistricting plan. Wisconsin was losing a district at the time, so the 4th and 5th were merged and some of the excess had to go into Ryan's district.
I missed the the tiny sliver that went into Waukesha County and I am not saying that the Democrats are innocent when it comes to the mess that is Wisconsin's congressional map. Incumbent protection plans can be just as bad as partisan gerrymanders. I had a class with John Sharpless, fun guy regardless of his political views.