Loading time and ping are in no way related.
During the loading screen the client is loading all of the assets for the map, champion information and all other relevant information required to play the game and places this into what is often called a "runtime environment".
The speed at which this happens is based purely on the performance of your computer. Mainly CPU/RAM speeds and hard drive read speed. Ping is just a measure of the amount of time it takes your computer to contact the riot servers and receive a response.
Basically all the assets and files that are required to run the program are copied from the hard drive and placed into your computers RAM or running memory.
I should also add that it is not loading ALL of the files belonging to League of Legends, just those that are required for the current game. Relevant champions, relevant map, neutral monsters, etc. etc. For example, when you play a standard 5v5 game on Summoner's Rift, it doesn't also load Twisted Treeline or any related information to it.