What the diff between onload and setup and before_load and refresh and onload_post_rend events in js

i read the doc but i did not get it
Form Scripts
if i have a query which event should i use? and why?