Most logic steps must happen on the server. They retrieve the necessary data, perform business logic and calculations, and then your application’s screen is redisplayed to the user.
However, you can also specify client-side actions, like showing a hidden widget.
Usually, your routine is either all client-side or all server-side. However, if you mix the two, all client-side steps will occur before control is passed to any server-side steps, regardless of how they are arranged in the routine.