Of course, as tools improve, the line between traditional tools and visual tools is becoming more and more blurry. Most often, this code handles events. For example, if you click on a button, it generates an event. When the program starts, that generates an event. If the user resizes the window, enters text, or clicks on a menu, events are generated.
Visual tools are excellent for prototyping.
First, you can rapidly draw a screen and show it to end users. If the users don't like what you have, you can rearrange it to suit them right on the spot. Also, many sophisticated end users can design simple interfaces themselves. Nothing lowers end-user resistance better than giving them some ownership of the project. The downside to most visual languages is that they can't do everything.