Samuel anointed Saul as king before it was time for his inauguration. At the point of his ordination Samuel made a series of minor prophecies aimed at validating his claim about Saul. Some donkeys that Saul had been looking for were to be found, certain events were supposed to occur during Saul's forthcoming journey and Saul was to end up prophesying like Samuel. These signs were meant to prove that Saul would indeed become king. And, every prediction came to be. Not only did those prognostications occur, on that same day God changed Saul's perspective on life (I Samuel 10:9).
So... God, Samuel and Saul knew that Saul was going to become Israel's king... but the people did not know. So, Samuel went through a "random" drawing (which was an accepted method of discovering God's will in those days). With the general population present, Samuel did this, not to discover God's plan, but to reveal it; to show that God had chosen Saul the son of Kish from the tribe of Benjamin to be their king.