I was wondering, why is it necessary to use a comma when the if clause preceds the main clause. I know the rule but I want another reason. Could you please help me???
Most punctuation rules at the end come down to reflecting the way we speak. Sometimes there are arbitrary rules that somebody has made up, but mostly that's what they are.
The fact is that when we say a conditional clause before the main clause, we mostly pause, and take a new prosodic group when we start the main clause - perhaps because otherwise it won't be clear that we've got to the main clause. The comma reflects this (natural, untaught) speech habit.
Sometimes in conversation, when the conditional is short, we don't pause after it: if you can do it quickly [no pause] go ahead! But that is a conversational variant: if you slow that sentence down, there will be a pause after "quickly".
[Comment moved to an answer by request, and expanded].