Moses had been judging the people for a while. I’m not sure how long, but long enough that his father-in-law, came to him and said, “what are you doin to yourself and these people?” He said much much more, but that is kind of how he started out. I don’t want to get into all the particulars, but this is before the “10 Commandments” were given.
Moses had been sitting in one place, and the people would come to him with every little thing going on in their life and God would speak to Moses and tell him what to tell them. But, there was a better way and he chose men to be captains over thousands, captains over hundreds, and captains over tens. So that it was a more “decentralized command.”
When Moses went up on mount Sinai, he was surprised when God gave him the Law. Moses wasn’t expecting that (more than likely, God didn’t tell him what exactly was going to happen). Moses was also surprised, and angry when he came down and saw the people worshiping the golden calf, God wasn’t. God knew He was going to give Moses the Law, and knew how the people would be acting when He did.
The people were not surprised by the Law. They weren’t surprised because Moses had been telling them these things under divine inspiration, when he was judging them. Moses had already been acting out this divinely revealed Law. What God had already been speaking through Moses, was now the Law.
God’s Word shouldn’t surprise us, He has already been telling us these things. Typically when I receive revelation about something, it is something that I had read several times and all of sudden it just jumps out at me. Usually, He has been trying to tell me something, and then I finally “get it.”
It usually isn’t that He isn’t speaking to us, we usually just aren’t “getting it” until we go through some things that get us in the proper “position” to receive it. Most of us don’t hear from God, because He usually doesn’t just flat out say something, he takes us through things to prepare us to receive his Word.