The principal of sovereign immunity, which prohibits the suing of the state or political subdivisions (boroughs, cities, school districts, etc.), has been around for a long time and grew out of the old English theory of “the King can do no wrong.” That got tossed out by the Pennsylvania Supreme Court in 1978 and after a couple of years of proving that the King could do a lot of wrong, the Legislature passed two laws. One gave immunity back to the state with certain exceptions and the other gave immunity back to political subdivisions, also with certain exceptions. These exceptions allow the injured to sue the state or city.
In the last 20 years, rulings of the Commonwealth Court (which hears all appeals concerning the state or political subdivisions) have greatly narrowed two of these exceptions. One says that you can sue the state for a dangerous condition of realty owned by PennDOT, and the other is for the operation of a motor vehicle by a political subdivision.
Both of these exceptions were restored to their proper breadth in two recent cases by the Supreme Court.