I think you are referring to the current law, not the history before that.
Currently Presidential succession is determined by the Presidential Succession Act of 1947 and subsequent amendments. Prior to the Act of 1947 the line of succession had consisted of various combinations if the President Pro Tem, Speaker, and Cabinet secretaries.
In 1947 the current system was implemented with the Speaker following the VP. There are a few reasons suspected as to why the Speaker is above the President Pro Tem. The two most agreed upon are: