First you click and treat, click and treat. This is called "charging" the clicker. The dog learns that the click means a treat is coming. Then you can use the clicker to tell the dog, "you did something that's going to get a treat!" Then the dog is happy as soon as he hears the click, since he can expect a treat. It's the same principle as kids hearing the bell for recess. The bell itself isn't inherently great, it's just a noise. It means that recess is coming. But because kids love recess, they learn to love the bell too.
When you are teaching something new, it's very consistent. One click, one treat. Then as you go into maintenance mode, you make it more random. But you can cross that bridge when you come to it.