The IF statement is the trigger that causes the action to take place. In every application it could be different. Without looking at your code in context I really couldn't determine if or why you should be using one trigger over the other.
In general if (true) means to run every time the page loads. If it is an insert or update, usually it will refer to the form button and a $_POST value so that it only runs when the form is filled out and doesn't run twice (once when the page loads and another time when the form is submitted)